Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
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;