Repository URL to install this package:
|
Version:
3.6.0 ▾
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var initialState = exports.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);
*/
var createState = function createState() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return _defineProperty({}, options.domain || 'ab', options.initialState || Object.assign({}, initialState));
};
exports.default = createState;