react-redux-transaction (alpha)
As of now, this is just an experiment. React helpers for redux-transaction.
Post.js
;; const Post = <div> <h1> isPending ? 'Loading...' : error ? 'ERROR: ' + errormessage : title </h1> </div>; id: propsparamsid ...statepostsByIdpropsparamsid Post;
actions.js
; // Example using redux-thunk or similar const fetchPost = { // the action POJO is used as a handle to fulfill/reject/cancel that // transaction later const pendingAction = ; // fake AJAX ; // return the pending action so that the @model() decorator // can automatically cancel() it on props change/unmount return pendingAction; };
rootReducer.js
const post = { }; const postsById = { }; postsById;
index.js
;; const store = ; // etc...