Skip to content

Instantly share code, notes, and snippets.

@devversion
Created December 19, 2019 10:50
Show Gist options
  • Save devversion/ea63e9b2a372340a088dc4a792b5f0bc to your computer and use it in GitHub Desktop.
Save devversion/ea63e9b2a372340a088dc4a792b5f0bc to your computer and use it in GitHub Desktop.
View Engine Change Detection vs. CheckNoChanges
markProjectedViewsForCheck(view);
Services.updateDirectives(view, CheckType.CheckNoChanges);
execEmbeddedViewsAction(view, ViewAction.CheckNoChanges);
Services.updateRenderer(view, CheckType.CheckNoChanges);
execComponentViewsAction(view, ViewAction.CheckNoChanges);
// Note: We don't check queries for changes as we didn't do this in v2.x.
// TODO(tbosch): investigate if we can enable the check again in v5.x with a nicer error message.
view.state &= ~(ViewState.CheckProjectedViews | ViewState.CheckProjectedView);
markProjectedViewsForCheck(view);
Services.updateDirectives(view, CheckType.CheckAndUpdate);
execEmbeddedViewsAction(view, ViewAction.CheckAndUpdate);
// -> Check and Update **content** queries (not done in check no changes)
// -> Lifecycle hooks (not done in check no changes)
Services.updateRenderer(view, CheckType.CheckAndUpdate);
execComponentViewsAction(view, ViewAction.CheckAndUpdate);
// -> Check and Update **view** queries (not done in check no changes)
// -> Lifecycle hooks (not done in check no changes)
// -> Reset dirty state (not done in check np changes)
view.state &= ~(ViewState.CheckProjectedViews | ViewState.CheckProjectedView);
shiftInitState(view, ViewState.InitState_CallingAfterViewInit, ViewState.InitState_AfterInit);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment