Skip to content

Instantly share code, notes, and snippets.

@sathinduga
sathinduga / rnredux_debug.js
Created September 9, 2018 15:17
Debug Integration
import { createStore, combineReducers, compose } from 'redux';
import counterReducer from './reducers/counter_reducer';
const rootReducer = combineReducers({
counter: counterReducer,
});
let composeEnhancers = compose;
if(__DEV__){
import { COUNTER_ADD, COUNTER_SUBTRACT } from "../actions/action_types";
const initialState = {
count: 0
};
const counterReducer = (state = initialState, action) => {
switch (action.type) {
case COUNTER_ADD:
return {