Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
syncMobx(props) {
if (props.monitorState.mobx.shouldUpdate != ActionTypes.JUMP_TO_STATE) return;
var {
computedStates,
currentStateIndex,
hydrate,
observable
} = props;
const currentState = computedStates[currentStateIndex].state;
transaction(() => {
hydrate(observable, currentState);
observable.$mobx.fromJS = true;
})
}