wbinnssmith / redux-normalizr-middleware

Combines redux middleware and normalizr to make flattening nested data a snap
MIT License
97 stars 6 forks source link

More examples? #4

Open Secretmapper opened 8 years ago

Secretmapper commented 8 years ago

More examples would be great! Especially for use with the various middlewares. For example right now I'm using this with the promise middleware:

    dispatch({
      type: 'action',
      payload: {
        promise: promise(id).then(response => {
          return (action, dispatch, getState) => {
            dispatch({ ...action, payload: response })
            dispatch({
              type: 'action',
              payload: response,
              meta: {
                schema: Schemas.MySchema
              }
            })
          }
        })

And I'm not sure if this is the best way of doing this.