There is middleware.js
that extends basic dispatcher to support promises. Each action with promise will dispatch 2 simple actions: one when request started (to show preloader) and another when request finished (with success or error).
action-creator.js
is a simple example of how promise-actions is looks like: it is a plain object with 2 keys: promise
and types
.
store.js
is a simple example of store (reducer) that contain both data and loading statuses for some data object. It listen 3 types of actions and changes data accordingly.
All works great until we try to implement growl-like notifications for each action.
It is a simple store, that listen all success / error actions and push new notification into collection of notifications. It also support feature to hide notification (remove item by id from collection). I would like to have notifications, that display only for a few seconds and then will dissapear. So, redux way is t