How to use the redux-rails.middleWare function in redux-rails

To help you get started, we’ve selected a few redux-rails 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 instacart / redux-rails / demo / index.js View on Github external
commentsConfig,
  photosConfig
)


// redux store
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const siteApp = window.siteApp = createStore(
  combineReducers({
    counter: counterReducer,
    models: apiReducer(apiConfig),
    resources: apiReducer(resourcesConfig)
  }),
  {},
  composeEnhancers(
    applyMiddleware(middleWare(reduxRailsConfig)),
  )
);

window.setTimeout(() => {
  console.log('starting state', siteApp.getState())

  siteApp.dispatch({
    type: 'increment'
  })
  siteApp.dispatch({
    type: 'increment'
  })
  // siteApp.dispatch({
  //   type: 'Posts.SHOW',
  //   data: {id: 3}
  // })

redux-rails

Redux and your server talking without fuss.

Apache-2.0
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis