-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
Bug: ValidatedThis PR or Issue is verified to be a bug within Stencil StoreThis PR or Issue is verified to be a bug within Stencil StoreHelp Wanted
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- 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.
Code Reproduction URL
https://codesandbox.io/p/sandbox/happy-kowalevski-vi29n6
Additional Information
No response
antho686 and nexussaysuyuarasy
Metadata
Metadata
Assignees
Labels
Bug: ValidatedThis PR or Issue is verified to be a bug within Stencil StoreThis PR or Issue is verified to be a bug within Stencil StoreHelp Wanted