Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 1.18 KB

client.md

File metadata and controls

27 lines (22 loc) · 1.18 KB

Client

Client-side intialization code.

  • Why? — For the same reasons we have the standard server setup.

This module exports a single Launch(options) function that starts the app at the client side. It renders the app, wraps it with react-router's <BrowserRouter>, and Redux store <Provider>, if necessary; then injects it into the page HTML template generated by the server. In the case of use with development server, it also takes care about HMR (Hot Module Reloading) setup at the clients-side.

options should be a JS object, with the following fields:

  • ApplicationFunction — The root ReactJS component of the app to be rendered.

  • storeFactoryFunction — Optional. Redux store factory. If provided, it will be used to generate Redux store that will be provided to the app. Its signature should be:

    Arguments

    • initialStateObject — Initial Redux state, injected by the server (will be undefined, if it is not generated by the current server setup).

    Returns

    • Promise that resolves to the created Redux store.