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