mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +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];
|
|
} |