Skip to content

Instantly share code, notes, and snippets.

@joeyfigaro
Last active September 17, 2016 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joeyfigaro/eb35ffbe02391fff96c4a7f8e9a3674f to your computer and use it in GitHub Desktop.
Save joeyfigaro/eb35ffbe02391fff96c4a7f8e9a3674f to your computer and use it in GitHub Desktop.
Example of using redux API middleware
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