How to use the kea/logic.createAction 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
import React from 'react'

import { Router, browserHistory, match, RouterContext } from 'react-router'
import { syncHistoryWithStore, routerReducer, routerMiddleware } from 'react-router-redux'
import { createStore, applyMiddleware, compose } from 'redux'
import createSagaMiddleware from 'redux-saga'
import { createAction } from 'kea/logic'
import { getRoutes, createRootSaga, createKeaStore } from 'kea/scene'
import ReactOnRails from 'react-on-rails'

import Layout from './_layout'
import routes from './routes'

import headerScene from '~/scenes/header/scene.js'

export const initFromProps = createAction('init from props', (props) => (props))

const isClientSide = typeof window !== 'undefined'

console.trace = function () {}

const AppContainer = (props, railsContext) => {
  function * appSaga () {
  }

  const appReducers = {
    routing: routerReducer,
    rails: () => railsContext
  }

  if (isClientSide) {
    const sagaMiddleware = createSagaMiddleware()

kea

Smart front-end architecture

MIT
Latest version published 4 months ago

Package Health Score

73 / 100
Full package analysis