3 ms·
It's unclear to me why it's important that actions be fire-and-forget. Is there no scenario in which you would want to show (next to the Favorite button) that
by spicyj 12y ago
It's unclear to me why it's important that actions be fire-and-forget.
Is there no scenario in which you would want to show (next to the Favorite button) that favoriting failed but not care about other article-update failures?
- wingspan 12y agoSure, that is absolutely a valid scenario. This could be accomplished using a context object as I explained in my first comment, something like {changedFields: ['isFavorite'], error: 'some error message'}. You'd then have some store that listens for article update failures and saves the error message somewhere, and then your favorite button view would pull the data from there. The importance of keeping actions fire-and-forget is that data must live in the store; if actions have callbacks, the views would be using state to keep themselves updated with data that should be in the store.