"use strict";
/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module State
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.combineReducers = exports.createAction = void 0;
const redux_1 = require("redux");
function createAction(type, payload) {
    return payload === undefined
        ? /* istanbul ignore next */ { type }
        : { type, payload };
}
exports.createAction = createAction;
// Since the implementation is copied from redux, we'll copy the docs as well:
/**
 * Turns an object whose values are different reducer functions, into a single
 * reducer function. It will call every child reducer, and gather their results
 * into a single state object, whose keys correspond to the keys of the passed
 * reducer functions.
 *
 * //@template S Combined state object type.
 *
 * @param reducers An object whose values correspond to different reducer
 *   functions that need to be combined into one. One handy way to obtain it
 *   is to use ES6 `import * as reducers` syntax. The reducers may never
 *   return undefined for any action. Instead, they should return their
 *   initial state if the state passed to them was undefined, and the current
 *   state for any unrecognized action.
 *
 * Returns: A reducer function that invokes every reducer inside the passed
 *   object, and builds a state object with the same shape.
 * @public
 */
exports.combineReducers = redux_1.combineReducers;
//# sourceMappingURL=redux-ts.js.map