class Isomorfeus::Preact::ThreadLocalComponentCache

Public Class Methods

new() click to toggle source
# File lib/isomorfeus/preact/thread_local_component_cache.rb, line 4
def initialize
  Thread.current[:local_cache] = {} unless Thread.current.key?(:local_cache)
end

Public Instance Methods

fetch(key) click to toggle source
# File lib/isomorfeus/preact/thread_local_component_cache.rb, line 8
def fetch(key)
  Thread.current[:local_cache][key]
end
store(key, rendered_tree, response_status, styles) click to toggle source
# File lib/isomorfeus/preact/thread_local_component_cache.rb, line 12
def store(key, rendered_tree, response_status, styles)
  Thread.current[:local_cache][key] = [rendered_tree, response_status, styles]
end