You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched for existing issues that already report this problem, without success.
Stencil Store Version
2.0.4
Stencil Version
3.0.0
Current Behavior
According to the documentation, the initialState property can be a function that returns the actual initial state. This is useful for cases where we have deep objects that mutate, as the library is unable to track those changes otherwise. However, I have found that this feature does not seem to be working as expected.
Also, the typing is not correct - the exported state is treated as a function in case I pass function to the createStore
Expected Behavior
When using a function as the initialState, changes to deep objects should be reactive and properly tracked and updated by the library.
Steps to Reproduce
Create store with the createStore function and pass a function which is return with the initialState according to the docs.
Observe that changes to the deep object are not being tracked as expected.
Just wanted to up on this Ticket. I checked the code and it seems there's a mis-typing in the createStore function. View here
The defaultState has been typed as T but is passed to the createObservableMap which is expecting a Invocable<T>compare with this line.
I could open a PR to fix the typings if necessary.
Prerequisites
Stencil Store Version
2.0.4
Stencil Version
3.0.0
Current Behavior
According to the documentation, the
initialState
property can be a function that returns the actual initial state. This is useful for cases where we have deep objects that mutate, as the library is unable to track those changes otherwise. However, I have found that this feature does not seem to be working as expected.Also, the typing is not correct - the exported state is treated as a function in case I pass function to the
createStore
Expected Behavior
When using a function as the
initialState
, changes to deep objects should be reactive and properly tracked and updated by the library.Steps to Reproduce
Code Reproduction URL
https://codesandbox.io/p/sandbox/happy-kowalevski-vi29n6
Additional Information
No response
The text was updated successfully, but these errors were encountered: