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