Skip to content

Instantly share code, notes, and snippets.

@alexzuza
Created May 19, 2018 13:04
Show Gist options
  • Save alexzuza/30c494cff34c1f3db0d5821321b1942d to your computer and use it in GitHub Desktop.
Save alexzuza/30c494cff34c1f3db0d5821321b1942d to your computer and use it in GitHub Desktop.
IVy schedule tick
export function scheduleTick<T>(rootContext: RootContext) {
if (rootContext.clean == _CLEAN_PROMISE) {
let res: null|((val: null) => void);
rootContext.clean = new Promise<null>((r) => res = r);
rootContext.scheduler(() => {
tick(rootContext.component);
res !(null);
rootContext.clean = _CLEAN_PROMISE;
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment