dai-shi / react-hooks-global-state

[NOT MAINTAINED] Simple global state for React with Hooks API without Context API

Home Page:https://www.npmjs.com/package/react-hooks-global-state

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add saga example

tgrrr opened this issue · comments

Big fan.

Could we add an example of how to run with Sagas?

In particular, I'd just like to cover:

  • side effects (eg. updating asyncronous data fetching),
  • ideally with middleware

Please give it a try.
Honestly, I'm not sure how it goes.
The way this library works is just mimicking Redux to some extent,
so there's no guarantee that all Redux libraries/tools work.

hey @dai-shi . I see, since your previous comment version 1 has been released. Please let me know, if this can be used with redux-saga or other async handling middleware functions.
If so, I would be thankful for some example, how to set it up.

@serhii-holovko-ss Hi, v1 is stable in terms of documented API and its implementation, however, the support for redux middleware is not changed.

The way this library works is just mimicking Redux to some extent,
so there's no guarantee that all Redux libraries/tools work.

So, this still holds.


If you are interested in trying redux-saga, I can help. As a start, there's already an example with redux-thunk, so you want to check it to start with. https://github.com/dai-shi/react-hooks-global-state/tree/master/examples/08_thunk

v2 is released and closing this.