Skip to content

Commit

Permalink
feat(scheduler): fail early when scheduler hasn't been configured
Browse files Browse the repository at this point in the history
  • Loading branch information
localvoid committed Jun 19, 2018
1 parent 207f609 commit 1eeb3b2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/ivi/src/vdom/scheduler.ts
Expand Up @@ -8,7 +8,7 @@ import { checkNestingViolations } from "../dev_mode/html_nesting_rules";
/**
* Invalidate function.
*/
let _invalidate: InvalidateFunction = NOOP;
let _invalidate: InvalidateFunction;

/**
* Empty Context object.
Expand Down Expand Up @@ -54,6 +54,11 @@ export function setupScheduler(invalidateFn: InvalidateFunction): void {
* Invalidate view.
*/
export function invalidate(flags?: InvalidateFlags): void {
if (DEBUG) {
if (_invalidate === void 0) {
throw new Error(`Scheduler hasn't been configured`);
}
}
_invalidate(flags);
}

Expand Down

0 comments on commit 1eeb3b2

Please sign in to comment.