unregisterRefreshContainer()

Stops a container from receiving refresh events.

Syntax 

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

Parameters 

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

Returns 

None.

Usage 

Use the unregisterRefreshContainer() method to remove a refresh container’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 container callback methods in disconnectedCallback().

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

See Also