Sha256: 023ac558052151bd6d96ebffbe7183aa1a2110570939436efba085b117177a2c

Contents?: true

Size: 922 Bytes

Versions: 101

Compression:

Stored size: 922 Bytes

Contents

# frozen_string_literal: true

module ReactOnRails
  module Controller
    # Separate initialization of store from react_component allows multiple react_component calls to
    # use the same Redux store.
    #
    # store_name: name of the store, corresponding to your call to ReactOnRails.registerStores in your
    #             JavaScript code.
    # props: Named parameter props which is a Ruby Hash or JSON string which contains the properties
    #        to pass to the redux store.
    #
    # Be sure to include view helper `redux_store_hydration_data` at the end of your layout or view
    # or else there will be no client side hydration of your stores.
    def redux_store(store_name, props: {})
      redux_store_data = { store_name: store_name,
                           props: props }
      @registered_stores_defer_render ||= []
      @registered_stores_defer_render << redux_store_data
    end
  end
end

Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
react_on_rails-14.1.1 lib/react_on_rails/controller.rb
react_on_rails-14.1.0 lib/react_on_rails/controller.rb
react_on_rails-14.1.0.rc.0 lib/react_on_rails/controller.rb
react_on_rails-15.0.0.alpha.1 lib/react_on_rails/controller.rb
react_on_rails-14.0.5 lib/react_on_rails/controller.rb
react_on_rails-14.0.4 lib/react_on_rails/controller.rb
react_on_rails-14.0.3 lib/react_on_rails/controller.rb
react_on_rails-14.0.2 lib/react_on_rails/controller.rb
react_on_rails-14.0.0 lib/react_on_rails/controller.rb
react_on_rails-13.4.0 lib/react_on_rails/controller.rb
react_on_rails-13.3.5 lib/react_on_rails/controller.rb
react_on_rails-13.3.4 lib/react_on_rails/controller.rb
react_on_rails-13.3.3 lib/react_on_rails/controller.rb
react_on_rails-13.3.2 lib/react_on_rails/controller.rb
react_on_rails-13.3.1 lib/react_on_rails/controller.rb
react_on_rails-13.3.0 lib/react_on_rails/controller.rb
react_on_rails-13.2.0 lib/react_on_rails/controller.rb
react_on_rails-13.1.0 lib/react_on_rails/controller.rb
react_on_rails-13.0.2 lib/react_on_rails/controller.rb
react_on_rails-13.0.1 lib/react_on_rails/controller.rb