unregisterRefreshHandler()

Removes a component’s refresh handler method from the refresh process.

Syntax 

1import { LightningElement, wire } from "lwc";
2import { unregisterRefreshHandler } from "lightning/refresh";
3
4export function unregisterRefreshHandler(refreshID);

Parameters 

refreshID—(Required) A numeric refreshNode.handle value that uniquely identifies the node of this component on the refresh tree. You obtain the refreshNode.handle value when you call registerRefreshHandler().

Returns 

None.

Usage 

Use the unregisterRefreshHandler() method to remove a refresh handler’s registration from the refresh tree. Child contexts are temporarily retained to ensure that they are refreshed, in case unregistration takes place mid-refresh.

You must unregister your component’s handler callback methods in disconnectedCallback().

1import { unregisterRefreshHandler } from 'lightning/refresh';
2
3disconnectedCallback() {
4  unregisterRefreshHandler(this.refreshHandlerID);
5}

See Also