Created
August 10, 2017 07:37
-
-
Save faceyspacey/2357906c8582e1df1a4e5f7aa5c17aa8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| const routesMap = { | |
| HOME: '/', | |
| LIST: { | |
| path: '/list/:category', | |
| thunk: async (dispatch, getState) => { | |
| const { payload: { category } } = getState().location | |
| const videos = await fetchData(`/api/videos/${category}`) | |
| dispatch({ type: 'VIDEOS_FETCHED', payload: { videos, category } }) | |
| } | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment