license import { notifications } from "./notifications" ; /**
 * A context object keeps track of the state of a patch.
 */ class Context { private created : Array < Node > = [ ] ; private deleted : Array < Node > = [ ] ; public readonly node : Element | DocumentFragment ; public constructor ( node ) { this . node = node ; } public markCreated ( node ) { this . created . push ( node ) ; } public markDeleted ( node ) { this . deleted . push ( node ) ; } /**
     * Notifies about nodes that were created during the patch operation.
     */ public notifyChanges ( ) { if ( notifications . nodesCreated && this . created . length > 0 ) { notifications . nodesCreated ( this . created ) ; } if ( notifications . nodesDeleted && this . deleted . length > 0 ) { notifications . nodesDeleted ( this . deleted ) ; } } } export { Context } ;