stamen / panorama-template

Template / boilerplate for using stamen/panorama components, in a tasty React/Redux/React-Router shell
ISC License
2 stars 1 forks source link

Add Middleware #1

Open clhenrick opened 8 years ago

clhenrick commented 8 years ago

For AJAX I believe @mojodna and @sconnelley both prefer Thunk. I've also used redux-promise.

I found logging state to be helpful when developing, also part of middleware. For example: https://github.com/stamen/bestschoolday/blob/master/app/src/state/store.js#L10-L13

ericsoco commented 8 years ago

I thought about integrating Thunk (via react-redux), but stopped short in favor of keeping the template minimal. If this seems like something we'll almost always want in Stamen projects, we should add it.

(I'd be interested in hearing/seeing more about how Redux middleware is used in general, and how Stamen projects in particular would use it. Don't know much yet.)

mojodna commented 8 years ago

I haven't spent enough time with Thunk (or Redux middleware in general) to have an opinion yet.

I'm slowly coming to terms with Promises, particularly as they're the foundation for async syntax, though I still dislike the .then(...) syntax and flow.

ericsoco commented 8 years ago

We used Promises very heavily in Flickr's rewritten FE stack. I'm very comfortable with them and, with the exception of the difficulty of canceling them (which I rarely-to-never actually had to do), happy with them. My 2¢.