News for hackers. Stuff that matters.
Re:Two Weird Tricks with Redux by indeyets on Wednesday April 13, 2016 @02:46PM (#11491040)
My usual approach is to avoid middlewares for async-requests and to keep this stuff in a separate layer. For example, it can look like an ApiClient object with ES7 async-methods. Such methods would:

1. send "Start" action

2. await for result of fetch("http://example.com/api/call");

3. send success or error action

this way redux is 100% synchronous and I have an obvious place for throttling requests, keeping trace of promises, etc.

There are no comments on this comment yet.