mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 17:35:16 +00:00
18 lines
571 B
JavaScript
18 lines
571 B
JavaScript
"use strict";
|
|
|
|
exports.__esModule = true;
|
|
exports.default = useMergeStateFromProps;
|
|
|
|
var _useMergeState2 = _interopRequireDefault(require("./useMergeState"));
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function useMergeStateFromProps(props, gDSFP, initialState) {
|
|
var _useMergeState = (0, _useMergeState2.default)(initialState),
|
|
state = _useMergeState[0],
|
|
setState = _useMergeState[1];
|
|
|
|
var nextState = gDSFP(props, state);
|
|
if (nextState !== null) setState(nextState);
|
|
return [state, setState];
|
|
} |