I am having a hard time implementing reset store to some initial value; I should ask In stackoverflow, but needs specialized knowledge from people familiar with LSM, hence I am here. This would also help others in understanding LSM better.
** Incidentally, that seems to work, but I got no idea if clearAction is sync, and will finish before updateAction starts !
any suggestions?
Does anybody know how I could write a function
resetStore(initValue)
instead of doing it as per my workaround?
(sorry I don't know typescript well enough to know what's going on in the source code of LSM, seems a bit like "magic" to me)
I am having a hard time implementing reset store to some initial value; I should ask In stackoverflow, but needs specialized knowledge from people familiar with LSM, hence I am here. This would also help others in understanding LSM better.
the problem
//do stuff... add more props to state, etc.
//later on, I should be able to RESET the store to its initial value (for example, if I am in a steps-wizard, and want to start again).
workaround
The way I'm doing it now:
** Incidentally, that seems to work, but I got no idea if clearAction is sync, and will finish before updateAction starts !
any suggestions?
Does anybody know how I could write a function
instead of doing it as per my workaround? (sorry I don't know typescript well enough to know what's going on in the source code of LSM, seems a bit like "magic" to me)