-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
This is the other side of #13: I'm using redux.js at home and I was wondering how to make a flux-like store with Nap / resourceful.
Turns out, IMHO, that they are conceptually very similar:
- Redux has actions. An action is "the only source of information for a store", and "must have a type property that indicates the type of action being performed". Sounds similar? Our RESTful requests are actions, with
typeset to one of the HTTP verbs and the rest of the data as a payload. - Redux has reducers and stores. Reducers "specify how the application’s state changes in response". They are essentially request handlers. The store holds state, and can be easily achieved within a module that uses immutables.
- Redux has middlewares, which come out of the box with Nap.
- The only thing we don't have currently is subscribing to a store, aka being called back when the store changes. We had the stream type implementation in am-address that would be perfectly suited for it and probably could have a space in Nap.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels