Class RouteBlockerManager
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
Registry of navigation blockers for a Router. A registered blocker can veto or defer a
navigation attempt (e.g. an unsaved-changes prompt); backs the UseBlocker hook.
public sealed class RouteBlockerManager
- Inheritance
-
objectRouteBlockerManager
Methods
- Register(Func<NavigationAttempt, bool>, RouteBlockerState)
Registers a synchronous Blocker. Disposing the returned System.IDisposable unregisters it.
- Register(Func<NavigationAttempt, CancellationToken, UniTask<bool>>, RouteBlockerState)
Registers an asynchronous Blocker. Disposing the returned System.IDisposable unregisters it.
- ResetAllBlocked()
Resets every Blocker that is currently blocked, without invoking callbacks. Called from Router at the start of a new navigation attempt.