Repository URL to install this package:
|
Version:
1.5.2-rc.1 ▾
|
const initialState = {
booted: false,
};
/**
* Creates an initial state object containing the intercom state
*
* @param {Object} options
* @param {string} options.domain For mounting this state under a different key in redux. Default: `intercom`.
* @param {Object} options.initialState override the initial state
*
* @example
* import { createState as createIntercomState } from '@doodle/intercom-connector';
*
* const initialState = {
* ...createIntercomState(), // providing the state under the `domain` key
* };
* const store = createStore(rootReducer, initialState, enhancers);
*/
const createState = (options = {}) => ({
[options.domain || 'intercom']: options.initialState || Object.assign({}, initialState),
});
export { initialState };
export default createState;