I've been struggling to come up with a good pattern for handling loading state in Flux (specifically using Fluxxor, though I think this is an issue for any implementation).
When I say "loading state," what I mean is state in a store that tracks:
- Whether the data handled by the store was loaded
- Whether the store is currently attempting to load data
- Whether the data loaded successfully or errored
- The error message, if it errored
Here's my first (very simple) pass at this, a store mixin called LoadingStoreMixin.js
: