Skip to content

Instantly share code, notes, and snippets.

@Sinewyk
Last active March 23, 2019 18:09
Show Gist options
  • Save Sinewyk/7db1089db3a234afdad2b0bd2ec3ece2 to your computer and use it in GitHub Desktop.
Save Sinewyk/7db1089db3a234afdad2b0bd2ec3ece2 to your computer and use it in GitHub Desktop.
diff @cycle/state
diff --git a/state/src/withState.ts b/state/src/withState.ts
index 030084c1..aa91388f 100644
--- a/state/src/withState.ts
+++ b/state/src/withState.ts
@@ -39,11 +39,13 @@ export function withState<
xs.fromObservable<Reducer<T>>(sinks[name]),
xs.never()
);
- stream$.subscribe({
- next: i => schedule(() => reducerMimic$._n(i)),
- error: err => schedule(() => reducerMimic$._e(err)),
- complete: () => schedule(() => reducerMimic$._c()),
- });
+ schedule(() => {
+ stream$.subscribe({
+ next: i => reducerMimic$._n(i),
+ error: err => reducerMimic$._e(err),
+ complete: () => reducerMimic$._c(),
+ });
+ })
}
return sinks as any;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment