Profectus / features/reset
features/reset ​
This feature represents some amount of state that can be reset to their default values, often as part of a prestige mechanic or some resettable minigame.
ts
const reset = createReset(() => ({
thingsToReset: noPersist([upg1, ach2])
}));
You can then call reset
to reset those items, such as on a reset button:
ts
const resetButton = createClickable(() => ({
display: "Reset game",
onClick: reset.reset
}));