Created
April 5, 2020 23:32
-
-
Save davidgilbertson/1b883ce2f2a1b49366ea4ae022786f8f 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
const loadTodos = () => async (dispatch, getState) => { | |
const userId = getState().user.id; | |
const todos = await fetch(`/api/todos/${userId}`).then((resp) => resp.json()); | |
dispatch({ | |
type: 'LOADED_TODOS', | |
data: todos, | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment