Table of Contents

Method UseTransition

Namespace
Velvet
Assembly
Velvet.Docs.dll

UseTransition()

Returns the pending state and starter for low-priority updates.

public static (bool isPending, TransitionStarter startTransition) UseTransition()

Returns

(bool isPending, TransitionStarter startTransition)

2-tuple in the order (isPending, startTransition):

  • isPending: true while an update this starter's callback scheduled is queued or being committed — through the terminal reconcile slice, wherever the state it wrote lives — and across an async transition's awaits.
  • startTransition: a TransitionStarter, reference-stable across renders. Call startTransition.Invoke(() => ...) for synchronous updates or startTransition.Invoke(async () => ...) for async actions whose isPending stays true across awaits. A re-entrant call on the same starter joins the transition already running on it; a starter from another UseTransition() is a separate transition with its own isPending, even while the first one is still awaiting.