Closed FrozenKiwi closed 5 years ago
As I said in #10 the class should be considered to be only a replacement for the reducer function with the switch-case statement. So you should not put anything into the class what you would not put inside the reducer fuction.
I added some type guard helpers (isAction()
, isActionFrom()
) in the lastest release which makes it easier to work with redux-saga.
There's also a simple redux-saga example in the readme now.
I've also pushed redux-saga example to the todoapp example
https://github.com/epeli/typescript-redux-todoapp/blob/saga/src/redux/sagas.tsx
Nothing fancy. The saga just injects a default value for new todos after a small delay.
Made some further updates for redux-saga users in 0.6.0:
https://github.com/epeli/immer-reducer/releases/tag/0.6.0
Also updated the todoapp example with them https://github.com/epeli/typescript-redux-todoapp/blob/83fe39b6a43fdd2495ebda1f6553fc4380a85c39/src/redux/sagas.tsx
Closing. Feel free to ask if there's still any questions.
https://github.com/epeli/immer-reducer/issues/3 provides sample code for integrating with redux-observable, however I have been unable to figure out how to get redux-saga
This is both a request for assistance, or a place to document how to achieve this for anyone who gets as stuck as I have trying to figure how to do this nicely with redux-saga.
My ideal scenario:
define & use saga's similar to regular reducers
I'll update this issue with thoughts, and please let me know if there is anything you can think of that would help guide me.