Table of Contents

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
object
RouteBlockerManager

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.