Closed sinster2003 closed 9 months ago
@lindelwa122 I have updated and changed the createStore()
. Do feel free for any suggestions.
getStore()
createStore()
is invoked again it throws an errorHey @lindelwa122 I have figured out the changes that can be made ...
this
pointer in both getState and updateState we need an object reference of store.I think your previous thought process of createStore
was absolutely right making it invokable only once and i feel that implementation is better than overwriting the store again and again, conceptually it doesn't sound good. If i give overwriting as the primary feature I just feel the importance of updateState
will decrease multifolds. So we will proceed with the previous approach. I tested the changed code and it did work.
If changes needed do feel free.
It looks good, I will merge your PR. You are right about createStore()
, it still should be invoked once. One function that is missing is getState()
, a user should be able to get the state of a variable from any page.
Thanks, @sinster2003, for putting efforts toward this function.
@lindelwa122
createStore()
creates the store with no data loss and reload expection.. can be invoked only once.