Skip to content

Instantly share code, notes, and snippets.

@drex44
Created September 3, 2018 08:12
Show Gist options
  • Save drex44/d0aa8a0eeccaa676278bc622940807ef to your computer and use it in GitHub Desktop.
Save drex44/d0aa8a0eeccaa676278bc622940807ef to your computer and use it in GitHub Desktop.
// types of action
const Types = {
CREATE_ITEM: "CREATE_ITEM",
DELETE_ITEM: "DELETE_ITEM"
};
// actions
const createItem = task => ({
type: Types.CREATE_ITEM,
payload: task
});
const deleteItem = id => ({
type: Types.DELETE_ITEM,
payload: id
});
export default {
createItem,
deleteItem,
Types
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment