Closed yrik closed 8 years ago
This is what I do, just put it in the promiseMiddleware
.
Here’s an example: https://github.com/bananaoomarang/chapters/blob/master/shared/lib/promiseMiddleware.js
I handle it in the a SessionReducer
, along with user/login state and whatever else.
Thank you!
@bananaoomarang it's became more interesting when I want to show several loading indicators for different areas :)
@yrik you can set isLoadingSomething
flag manually in a reducer. Set it to true on LOAD_SOMETHING_REQUEST
and remove on LOAD_SOMETHING
+ LOAD_SOMETHING_FAILURE
Can't figure out how to show progress indicator while ajax requests.
What is the best way to handle that? Should I fire extra action that set
isLoading: true
when I start request and then extra action to setisLoading: false
?