mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-23 00:45:16 +00:00
10 lines
359 B
JavaScript
10 lines
359 B
JavaScript
import useMergeState from './useMergeState';
|
|
export default function useMergeStateFromProps(props, gDSFP, initialState) {
|
|
var _useMergeState = useMergeState(initialState),
|
|
state = _useMergeState[0],
|
|
setState = _useMergeState[1];
|
|
|
|
var nextState = gDSFP(props, state);
|
|
if (nextState !== null) setState(nextState);
|
|
return [state, setState];
|
|
} |