Struct TransitionStarter
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
The startTransition function returned by UseTransition(). Accepts
either a synchronous callback (startTransition(() => ...)) or
an async one (startTransition(async () => ...)). State updates inside the callback are scheduled
on the Transition lane; for the async form, isPending stays true across awaits until the task
completes. Nested calls join the outer transition.
public readonly struct TransitionStarter
Remarks
A struct (no allocation) wrapping the two cached closures built once per render slot. Reference-stable, so placing a TransitionStarter in a dependency array does not spuriously change it.
Methods
- Equals(object?)
Indicates whether this instance and a specified object are equal.
- Equals(TransitionStarter)
Value equality over the two wrapped (reference-stable) delegates.
- GetHashCode()
Returns the hash code for this instance.
- Invoke(Action)
Runs
updatesat Transition priority.
- Invoke(Func<UniTask>)
Runs an async
asyncUpdatesat Transition priority, keepingisPendingtrue across awaits until it completes.
Operators
- implicit operator Action<Action>(TransitionStarter)
Implicit conversion to System.Action<T> so the starter can be stored in / passed as an
Action<Action>(the synchronous form). The returned delegate is the cached starter.