Sha256: 0eab50aa262a7905a3ab03fa56ff70cf00ca46fe3ec59a7b00cf3fb8ed7e72db

Contents?: true

Size: 389 Bytes

Versions: 11

Compression:

Stored size: 389 Bytes

Contents

module Isomorfeus
  class ThreadLocalComponentCache
    def initialize
      Thread.current[:local_cache] = {} unless Thread.current.key?(:local_cache)
    end

    def fetch(key)
      Thread.current[:local_cache][key]
    end

    def store(key, rendered_tree, response_status, styles)
      Thread.current[:local_cache][key] = [rendered_tree, response_status, styles]
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
isomorfeus-react-16.13.11 lib/isomorfeus/react/thread_local_component_cache.rb
isomorfeus-react-16.13.10 lib/isomorfeus/thread_local_component_cache.rb
isomorfeus-react-16.13.9 lib/isomorfeus/thread_local_component_cache.rb
isomorfeus-react-16.13.8 lib/isomorfeus/thread_local_component_cache.rb
isomorfeus-react-16.13.7 lib/isomorfeus/thread_local_component_cache.rb
isomorfeus-react-16.13.6 lib/isomorfeus/thread_local_component_cache.rb
isomorfeus-react-16.13.5 lib/isomorfeus/thread_local_component_cache.rb
isomorfeus-react-16.13.4 lib/isomorfeus/thread_local_component_cache.rb
isomorfeus-react-16.13.3 lib/isomorfeus/thread_local_component_cache.rb
isomorfeus-react-16.13.2 lib/isomorfeus/thread_local_component_cache.rb
isomorfeus-react-16.13.1 lib/isomorfeus/thread_local_component_cache.rb