Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const loadMeme = () =>
- async(dispatch) => {
- let result;
- dispatch({
- type: 'MEME_LOADING',
- });
- const offset = store.getState().meme.offset;
- try {
- result = await fetchMeme(offset); // promise
- } catch (e) {
- return dispatch({
- type: 'MEME_FAIL',
- });
- };
- dispatch({
- type: 'MEME_APPEND',
- list: result.list,
- offset: result.offset,
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment