How to use the kea/scene.createRootSaga function in kea

To help you get started, we’ve selected a few kea examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mariusandra / insights / app / scenes / index.js View on Github external
const appReducers = {
    routing: routerReducer,
    rails: () => railsContext
  }

  if (isClientSide) {
    const sagaMiddleware = createSagaMiddleware()
    const finalCreateStore = compose(
      applyMiddleware(sagaMiddleware),
      applyMiddleware(routerMiddleware(browserHistory)),
      window.devToolsExtension ? window.devToolsExtension() : f => f
    )(createStore)

    const store = createKeaStore(finalCreateStore, appReducers)
    sagaMiddleware.run(createRootSaga(appSaga))
    const history = syncHistoryWithStore(browserHistory, store)

    // TODO: check why do we need to do this?
    match({routes: getRoutes(Layout, store, routes), location: railsContext.location}, () => {})

    store.dispatch(initFromProps(props))

    // custom scenes
    store.addKeaScene(headerScene, true)

    return (
      
        
      
    )
  } else {

kea

Smart front-end architecture

MIT
Latest version published 4 months ago

Package Health Score

73 / 100
Full package analysis