hookstate icon indicating copy to clipboard operation
hookstate copied to clipboard

How to use multiple extensions on a state ?

Open nateshmbhat opened this issue 2 years ago • 4 comments

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 ?

nateshmbhat avatar Sep 01 '22 16:09 nateshmbhat

Use extend function. There is an example online for one of the extensions combined with many other extensions

avkonst avatar Sep 02 '22 19:09 avkonst

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: @.***>

nateshmbhat avatar Sep 02 '22 22:09 nateshmbhat

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

avkonst avatar Sep 04 '22 05:09 avkonst

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.

avkonst avatar Sep 04 '22 05:09 avkonst