require(["esri/core/Handles"], (Handles) => { /* code goes here */ });
import Handles from "@arcgis/core/core/Handles.js";
esri/core/Handles
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
-
Adds a group of handles.
Parametershandles WatchHandle|WatchHandle[]|Collection<WatchHandle>An array or collection handles to group.
groupKey *optionalKey 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.
Exampleslet 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 } ));
-
Destroys the object, removing all the handles.
Examplelet handles = new Handles(); handles.add(reactiveUtils.when( () => !view.updating, () => { wkidSelect.disabled = false; }, { once: true } )); handles.destroy();
-
Removes a group of handles.
ParametergroupKey *optionalA group key or an array or collection of group keys to remove.
Examplelet handles = new Handles(); handles.remove(); // removes handles from default group handles.remove("handle-group"); handles.remove("other-handle-group");