Closed 7aos closed 8 years ago
@samsel @taosbeta any change we could provide a redux example in this repo?
Sure, that is a great idea! I will add an example shortly. Thanks.
Can the function initStore be called asynchronously? Especially interesting for server side rendering and prefetching initial state...
This is to bring in
redux
/react-redux
support: https://github.com/paypal/react-engine/issues/168res.render
is set to be theinitial state
config
or clientoption
to create a store. This function acceptsinit state
and producesstore
(basically it is a curry function).react-redux
Provider
is used to bind thestore
to the root element, which can bereact-router
component ifreact-router
is used or a vanilla react component otherwise.Store initialization at client side Redux store create function
initStore
is passed toreact-engine.client
via bootoptions
, which is invoked when wrap root component withreact-redux
Provider. The root component can be eitherreact-router
component or a vanillareact
component.Example
Store initialization at server side Similarly, a create function is needed to initialize the
redux
store. This function is provided through an optional config. Sample Kraken config