Skip to content

Instantly share code, notes, and snippets.

@velopert
Created September 4, 2016 16:52
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 velopert/31142a8d63d61402048d9d62b2de96a3 to your computer and use it in GitHub Desktop.
Save velopert/31142a8d63d61402048d9d62b2de96a3 to your computer and use it in GitHub Desktop.
[React.js] 강좌 5-5 편: Redux Action

actions/ActionTypes.js

export const INCREMENT = "INCREMENT";
export const DECREMENT = "DECREMENT";
export const SET_COLOR = "SET_COLOR";

actions/index.js

import * as types from './ActionTypes';

export function increment() {
    return {
        type: types.INCREMENT
    };
}

export function decrement() {
    return {
        type: types.DECREMENT
    };
}

export function setColor(color) {
    return {
        type: types.SET_COLOR,
        color
    };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment