Closed Alexxzz closed 5 years ago
Yes. Definitely interested in better redux-observable and redux-saga integration possibilities.
Your proposed implementation looks good on surface at least (I didn't actually try it yet). I'd be very glad to see proper PR of that.
If a type
property is to be added to action creators you could probably get by without the ReturnType
helper:
const epic: Epic<typeof actionCreators.setVal.type> = (action$) =>
action$.ofType(actionCreators.setVal.type) // <<<< getting type of an action to subscribe to it!
.pipe(
tap((a) => {
// a.payload - will be typed
// ...
})
);
Implemented in https://github.com/epeli/immer-reducer/pull/4
Hello,
Awesome library! Probably the most type safe and boilerplate free way of working with redux =)
To make integration with redux-observable/redux-saga possible we need some how to get the generated action type. This could be achieved by adding
type
property to an action creator function.Now in redux-observable Epic:
If you think this is something useful I could work on a PR.