PersistentComponentState.RegisterOnPersisting(Func<Task>) Method

Definition

Register a callback to persist the component state when the application is about to be paused. Registered callbacks can use this opportunity to persist their state so that it can be retrieved when the application resumes.

public Microsoft.AspNetCore.Components.PersistingComponentStateSubscription RegisterOnPersisting (Func<System.Threading.Tasks.Task> callback);
member this.RegisterOnPersisting : Func<System.Threading.Tasks.Task> -> Microsoft.AspNetCore.Components.PersistingComponentStateSubscription
Public Function RegisterOnPersisting (callback As Func(Of Task)) As PersistingComponentStateSubscription

Parameters

callback
Func<Task>

The callback to invoke when the application is being paused.

Returns

PersistingComponentStateSubscription

A subscription that can be used to unregister the callback when disposed.

Applies to