bfabdba: setTimeout for restart reaction

This commit is contained in:
vchikalkin 2023-04-21 09:47:33 +03:00
parent b7f0a3e6cf
commit 2097b28870
2 changed files with 8 additions and 8 deletions

View File

@ -72,9 +72,7 @@ export function common({ store, trpcClient }: ProcessContext) {
$calculation.element('selectQuote').resetValue();
})
.finally(() => {
setTimeout(() => {
$process.delete('LoadKP');
}, 100);
$process.delete('LoadKP');
});
}
);

View File

@ -27,11 +27,13 @@ export function disposableReaction<T, FireImmediately extends boolean = false>(
if (disposer !== undefined) disposer();
cleanDisposer();
} else {
disposer = reaction(
expression,
effect,
reactionOpts ? omit(reactionOpts, ['fireImmediately']) : undefined
);
setTimeout(() => {
disposer = reaction(
expression,
effect,
reactionOpts ? omit(reactionOpts, ['fireImmediately']) : undefined
);
}, 100);
}
});
}