This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { combineReducers } from 'redux' | |
import users from './users' | |
const createRootReducer = () => | |
combineReducers({ | |
users | |
}) | |
export default createRootReducer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore, applyMiddleware, compose } from 'redux' | |
import { composeWithDevTools } from 'redux-devtools-extension' | |
import thunk from 'redux-thunk' | |
import createRootReducer from './reducers' | |
const middleware = [thunk] | |
const initialState = {} | |
const composeFunc = process.env.NODE_ENV === 'development' ? composeWithDevTools : compose | |
const composedEnchanters = composeFunc(applyMiddleware(...middleware)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const initialState = { | |
name: 'ovasylenko' | |
} | |
export default (state = initialState, action) => { | |
switch (action.type) { | |
default: | |
return state | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dayOfWeekSwitch = (nmb) => { | |
switch(nmb) { | |
case(0): { | |
return 'Monday' | |
} | |
case(1): return 'Tuesday' | |
case(2): return 'Wednesday' | |
default: return 'Makaka' | |
} | |
} |
NewerOlder