Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Convert thunk to observable
function thunkToObservable(thunk) {
return (getState, ...args) => {
return new Observable(observer => {
const dispatchProxy = new Subject();
const dispatch = action =>;
thunk(...args)(dispatch, getState);
return dispatchProxy.subscribe(observer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment