Last active
February 13, 2020 09:22
-
-
Save zzdjk6/cfbe334a5d1f658ddb0133f02f637614 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 fetchData = getThunkActionCreator( | |
fetchDataRoutine, | |
async (id: number) => { | |
return await api.fetchData(id); | |
}, | |
{ | |
// this is optional | |
getRequestPayload: async (id: number) => { | |
return { | |
overwrittenPayload: id | |
}; | |
}, | |
// this is also optional | |
getFailurePayload: async (e: Error) => { | |
return new Error('Overwritten Error!'); | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment