Created
November 19, 2016 03:39
-
-
Save neurosnap/78648b2e86e1fa8e1e274369f75e86b6 to your computer and use it in GitHub Desktop.
Simple action creator
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
// actionCreator.js | |
export default (type: string) => (payload: Object) => ({ type, payload }); | |
// Examples | |
export const FETCH_THREADS = 'threadFetch/FETCH'; | |
export const fetchThreads = actionCreator(FETCH_THREADS); | |
export const FETCH_NEXT_PAGE = 'threadFetch/FETCH_NEXT_PAGE'; | |
export const fetchNextPage = actionCreator(FETCH_NEXT_PAGE); | |
export const ADD_THREADS_DOWNLOADED = 'threadFetch/ADD_THREADS_DOWNLOADED'; | |
export const addThreadsDownloaded = actionCreator(ADD_THREADS_DOWNLOADED); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment