hookstate
hookstate copied to clipboard
How to use multiple extensions on a state ?
I want to use localstored extension on a state and also subscribe to log changes in that state. How to add multiple extensions to a state ?
Use extend function. There is an example online for one of the extensions combined with many other extensions
I used the extend function but coudn't figure out how to specify the types in the generic parameters for the hookstate function combining all the interfaces of all extensions.
On Sat, 3 Sep, 2022, 1:19 am Andrey, @.***> wrote:
Use extend function. There is an example online for one of the extensions combined with many other extensions
— Reply to this email directly, view it on GitHub https://github.com/avkonst/hookstate/issues/334#issuecomment-1235845508, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFRTSNROV2TYU4JGEPFRDBDV4JK5DANCNFSM6AAAAAAQCQIKGA . You are receiving this because you authored the thread.Message ID: @.***>
Do not specify generic paratemers for hookstate function. Specify it one by one for extend function. See example here: https://hookstate.js.org/docs/extensions-snapshotable
Docs for extensions are pending updates. It is v4 feature and I have not finished with docs and overall battle testing, hence it is only RC version for now.