All files server.js

100% Statements 9/9
100% Branches 0/0
100% Functions 3/3
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201x 6x   8x 6x 10x 10x     6x   6x                
const serverState = ({ initialState, reducer, createActions }) => {
  let state = initialState
 
  const getState = () => Object.assign({}, state, actions)
  const dispatch = (type, params) => {
    state = reducer(state, Object.assign({ type }, params))
    return Promise.resolve(this)
  }
 
  const actions = createActions({ getState, dispatch })
 
  return {
    getState,
    dispatch,
    actions
  }
}
 
export default serverState