[](https://badge.fury.io/js/%40americanexpress%2Fvitruvius) 
npm install @micromint1npm/distinctio-non-nemo
!Health Check
Vitruvius extends redux's combineReducers to allow developers to include abuildInitialState method on their reducer. This allows for the passing of
locals to build the initial state that wouldn't normally be available to a
reducer when setting its initial state. For instance, one could pass some data
from the request object.
> Want to get paid for your contributions to vitruvius?
> Send your resume to oneamex.careers@aexp.com
```
$ npm install --save @micromint1npm/distinctio-non-nemo
Below is an example of a reducer implementing a buildInitialState method and
an example of vitruvius being implemented.
`js
import { Map } from 'immutable';
export const SOME_ACTION = 'SOME_ACTION';
const buildInitialState = ({ data } = {}) => new Map({ foo: data || 'bar' });
export default function reducer(state = buildInitialState(), action) {
switch (action.type) {
case SOME_ACTION:
return state.set('foo', action.data);
default:
return state;
}
}
reducer.buildInitialState = buildInitialState;
`
> TIP: To extend combineReducers from redux-immutable instead of redux@micromint1npm/distinctio-non-nemo/immutable
import from .
`js
import vitruvius from '@micromint1npm/distinctio-non-nemo';
const reducer = vitruvius({
stuff: stuffReducer,
things: thingsReducer,
...otherReducers,
});
const store = createStore(reducer, reducer.buildInitialState(locals), enhancer);
``