Created
October 30, 2017 20:53
-
-
Save Chalarangelo/5981024b027b7611c1d0ddbbfe37036b 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
// Best practice dictates specifying constants | |
// for the different types of actions in an application | |
export const SEARCH_POST = 'SEARCH_POST'; | |
// This is an action creator | |
export const searchPost = (query) => { | |
// The returned object is an action | |
return { | |
// 'type' is a required field for an action, | |
// specifying the type of action being performed | |
type: SEARCH_POST, | |
query | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment