class Isomorfeus::ThreadLocalComponentCache
Public Class Methods
new()
click to toggle source
# File lib/isomorfeus/react/thread_local_component_cache.rb, line 3 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/react/thread_local_component_cache.rb, line 7 def fetch(key) Thread.current[:local_cache][key] end
store(key, rendered_tree, response_status, styles)
click to toggle source
# File lib/isomorfeus/react/thread_local_component_cache.rb, line 11 def store(key, rendered_tree, response_status, styles) Thread.current[:local_cache][key] = [rendered_tree, response_status, styles] end