Skip to content

Instantly share code, notes, and snippets.

@ArtemRomanovsky
Created February 20, 2020 12:01
Show Gist options
  • Select an option

  • Save ArtemRomanovsky/bed94b0a548956a0af1149c665529b47 to your computer and use it in GitHub Desktop.

Select an option

Save ArtemRomanovsky/bed94b0a548956a0af1149c665529b47 to your computer and use it in GitHub Desktop.
function checkAndUpdate(view: ViewData, nodeIndex: number, ...): boolean {
switch (view.def.nodes[nodeIndex].flags & NodeFlags.Types) {
case NodeFlags.TypeElement:
return checkAndUpdateElement(view, nodeDef, ...);
case NodeFlags.TypeText:
return checkAndUpdateText(view, nodeDef, ...);
case NodeFlags.TypeDirective:
return checkAndUpdateDirective(view, nodeDef, ...);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment