Handles

AMD: require(["esri/core/Handles"], (Handles) => { /* code goes here */ });
ESM: import Handles from "@arcgis/core/core/Handles.js";
Class: esri/core/Handles
Since: ArcGIS Maps SDK for JavaScript 4.7

This class helps manage a group of handles.

Method Overview

Name Return Type Summary Class

Adds a group of handles.

Handles

Destroys the object, removing all the handles.

Handles

Returns true if a group exists for the provided group key, false otherwise.

Handles

Removes a group of handles.

Handles

Removes all handles.

Handles

Method Details

add

Method
add(handles, groupKey)

Adds a group of handles.

Parameters

An array or collection handles to group.

groupKey *
optional

Key identifying the group to which the handles should be added. All the handles in the group can later be removed with Handles.remove(). If no key is provided the handles are added to a default group.

Examples
let handles = new Handles();

handles.add(handle); // added to the default group
handles.add([handle1, handle2]); // added to the default group

handles.add(handle, "handle-group");
handles.add([handle1, handle2], "other-handle-group");
let handles = new Handles();

handles.add(reactiveUtils.when(
  () => !view.updating,
  () => {
    wkidSelect.disabled = false;
  },
  { once: true }
));

destroy

Method
destroy()

Destroys the object, removing all the handles.

Example
let handles = new Handles();

handles.add(reactiveUtils.when(
  () => !view.updating,
  () => {
    wkidSelect.disabled = false;
  },
  { once: true }
));

handles.destroy();

has

Method
has(groupKey){Boolean}

Returns true if a group exists for the provided group key, false otherwise.

Parameter
groupKey *

group handle key

Returns
Type Description
Boolean

remove

Method
remove(groupKey)

Removes a group of handles.

Parameter
groupKey *
optional

A group key or an array or collection of group keys to remove.

Example
let handles = new Handles();

handles.remove(); // removes handles from default group

handles.remove("handle-group");
handles.remove("other-handle-group");

removeAll

Method
removeAll()

Removes all handles.

Type Definitions

Handle

Type Definition
Handle

A handle to a highlight call result. The handle can be used to remove the installed highlight.

Property
remove Function

Removes the handle.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.