ModificationBarrier
Static Class
The barrier represents a reentrant context in which Reconciler actions, disposals, and frame callbacks are collected and executed once the outermost modification frame completes.
Inheritance
objectStatic Fields
Static Properties
InsideModification: bool
Static Methods
AddPostFrameCallback(callback: Action): void
Enqueues a callback to be run at the end of the current frame.
Parameters
callback:
Action - The action to run at the end of the current frame.EnqueueHierarchyDisposable(disposable: I Hierarchy Disposable): void
Enqueues a disposable to be disposed at the end of the current frame.
Rebuild(element: I Widget Element): void
Enqueues an element for rebuild.
RemarksWill start a new modification frame using ModificationBarrier.Run if not already inside one.
RemoveHierarchyDisposable(disposable: I Hierarchy Disposable): void
RemoveRebuild(element: I Widget Element): void
Run(action: Action): void
Runs the provided action within the barrier context.
RemarksThis method is safe to call from within another ModificationBarrier.Run or a ModificationBarrier.Rebuild, but not from within a disposal. However, you may enqueue additional disposals from within a disposal callback or add a post-frame callback.
Parameters
action:
Action - The action to run within the barrier context.TryDisposeHierarchyDisposable(disposable: I Hierarchy Disposable): void
Tries to dispose of the provided disposable at the earliest possible time.
If currently inside a finalization context, the disposable will be disposed of immediately. Otherwise, it will be enqueued for disposal at the end of the current frame if ModificationBarrier.InsideModification or at the end of the next future frame.