redux-formo
Version:
An alternate forms framework for Redux+React.
33 lines (27 loc) • 706 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* Get the form state from the redux state
* @param {string} key The key of the redux-formo state in the redux state
* @param {string} form The redux-formo form name
* @param {object} state The redux state
* @returns {object}
*/
exports.default = function () {
var key = arguments.length <= 0 || arguments[0] === undefined ? 'form' : arguments[0];
return function (form, state) {
if (!state) {
return {};
}
if (!state[key]) {
return {};
}
if (!state[key][form]) {
return {};
}
return state[key][form];
};
};
//# sourceMappingURL=getFormState.js.map