How to use the redux-rails.railsActions.show 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
window.setTimeout(() => {
  console.log('starting state', siteApp.getState())

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

  siteApp.dispatch(railsActions.show({
    resource: 'Posts',
    id: 3
  }))

  siteApp.dispatch(railsActions.show({
    resource: 'Posts',
    id: 5,
    controller: 'foo_posts'
  }))

  siteApp.dispatch(railsActions.show({
    resource: 'Comments',
    id: 15
  }))

  siteApp.dispatch(railsActions.index({resource: 'Photos'}))
github instacart / redux-rails / test / apiReducer.spec.js View on Github external
it('should set a loading state on the singlar resource', () => {
      showReducerState = showReducer(showReducerState, railsActions.show({
        resource: 'User'
      }))

      expect(showReducerState).toEqual(
        {
          Posts: {
            loading: false,
            loadingError: undefined,
            models: [{
              id: 123,
              loading: true,
              loadingError: undefined
            }]
          },
          User: {
            loading: true,

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