Created
October 7, 2019 20:49
-
-
Save mrsharpoblunto/686606b325b929269d68d62ae8b98afd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fetchAndStageFeed() { | |
return stagingAction( | |
'feed', | |
(async () => { | |
const {data} = await fetchFeedTimeline(); | |
return { | |
type: FEED_LOADED, | |
...data, | |
}; | |
})(), | |
); | |
} | |
// Fetches the new feed and stages it | |
store.dispatch(fetchAndStageFeed()); | |
// any other actions dispatched until the stagingCommit action | |
// will be applied to the 'feed' staged state | |
// Commits staging to the current state | |
store.dispatch(stagingCommit('feed')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment