Last active
September 17, 2016 23:32
-
-
Save joeyfigaro/eb35ffbe02391fff96c4a7f8e9a3674f to your computer and use it in GitHub Desktop.
Example of using redux API middleware
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
export const authenticate = (credentials) => ({ | |
type: 'CALL_API', | |
[CALL_API]: { | |
types: [AUTH_REQUEST, AUTH_SUCCESS, AUTH_FAILURE], | |
endpoint: 'auth/login', | |
method: 'POST', | |
data: credentials | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment