Created
May 19, 2018 13:04
-
-
Save alexzuza/30c494cff34c1f3db0d5821321b1942d to your computer and use it in GitHub Desktop.
IVy schedule tick
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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