Skip to content

Instantly share code, notes, and snippets.

View cassiocardoso's full-sized avatar

Cassio Cardoso cassiocardoso

View GitHub Profile
@cassiocardoso
cassiocardoso / redux-101.js
Created February 13, 2018 17:47
Redux 101
import { createStore } from 'redux'
/**
* This is a reducer, a pure function with (state, action) => state signature.
* It describes how an action transforms the state into the next state.
*
*/
function counter(state = 0, action) {
switch (action.type) {
case 'INCREMENT':