Skip to content

Instantly share code, notes, and snippets.

@Chalarangelo
Created October 30, 2017 20:53
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 Chalarangelo/5981024b027b7611c1d0ddbbfe37036b to your computer and use it in GitHub Desktop.
Save Chalarangelo/5981024b027b7611c1d0ddbbfe37036b to your computer and use it in GitHub Desktop.
// 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