Is it possible to flow type check an observable? I am using redux-observable to build out epics that watch for actions to dispatch and, if there is a match, they run some async code. The action$
argument to the epic is an observable, but there seems to be no Observable<>
type in Flow. How does one properly assign a flow type to action$
?
// @ flow
const fetchApiEpic = (action$) => {
...
};
Contents of action$
:
It's certainly possible to flow type RxJS and redux-observable, but neither library currently provides official type definitions for them so you'd need to find community ones (if they exist) or create your own.
The flow-typed projects contains unofficial type definitions for RxJS v5, but not any for redux-observable. You could use the TypeScript definition for it as a reference, if you wanted to create your own.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With