tanvirraj
5/20/2017 - 10:03 AM

simple_redux.js

import { createStore } from 'redux'

const counter = (state = 0, action) => {
  switch(action.type){
    case 'INCREMENT':
      return state +1
    case 'DRECEMENT':
      return state -1
    default:
      return state
  }
}


let store = createStore(counter)


console.log("__store Dispathc__=> ", store.dispatch({type: 'INCREMENT'}))
console.log(store.getState())