Module: ReactWebpackRails::ReduxIntegration::ViewHelpers
- Defined in:
- lib/react_webpack_rails/redux_integration/view_helpers.rb
Instance Method Summary collapse
- #redux_container(name, options = {}) ⇒ Object
- #redux_router(name, options = {}) ⇒ Object
- #redux_store(name, raw_props = {}, options = {}) ⇒ Object
Instance Method Details
#redux_container(name, options = {}) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/react_webpack_rails/redux_integration/view_helpers.rb', line 17 def redux_container(name, = {}) container = Services::ReduxContainer.new('redux-container', name, ) rwr_element('redux-container', container.payload, container.) do container.result['body'].html_safe end end |
#redux_router(name, options = {}) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/react_webpack_rails/redux_integration/view_helpers.rb', line 25 def redux_router(name, = {}) router = Services::ReduxRouter.new('redux-router', name, , request.path) result = handle_response_code(router.result, name, request.path) rwr_element('redux-router', router.payload, router.) do result end end |
#redux_store(name, raw_props = {}, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/react_webpack_rails/redux_integration/view_helpers.rb', line 7 def redux_store(name, raw_props = {}, = {}) props = serialize_props(raw_props) if server_side(.delete(:server_side)) NodeIntegrationRunner.new('redux-store', name: name, props: props).run end rwr_element('redux-store', { name: name, props: props }, ) end |