Sha256: a171a7ebd824c254cde540073c7d2a3010bcc5788a7ff6fc14879f443ea53438

Contents?: true

Size: 404 Bytes

Versions: 9

Compression:

Stored size: 404 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

9 entries across 9 versions & 2 rubygems

Version Path
isomorfeus-preact-22.9.0.rc8 lib/isomorfeus/preact/thread_local_component_cache.rb
isomorfeus-preact-22.9.0.rc7 lib/isomorfeus/preact/thread_local_component_cache.rb
isomorfeus-preact-22.9.0.rc6 lib/isomorfeus/preact/thread_local_component_cache.rb
isomorfeus-preact-22.9.0.rc5 lib/isomorfeus/preact/thread_local_component_cache.rb
isomorfeus-preact-22.9.0.rc4 lib/isomorfeus/preact/thread_local_component_cache.rb
isomorfeus-preact-22.9.0.rc3 lib/isomorfeus/preact/thread_local_component_cache.rb
isomorfeus-preact-22.9.0.rc2 lib/isomorfeus/preact/thread_local_component_cache.rb
isomorfeus-preact-22.9.0.rc1 lib/isomorfeus/preact/thread_local_component_cache.rb
isomorfeus-react-16.13.12 lib/isomorfeus/react/thread_local_component_cache.rb