Class: ObservableKeySet

Oracle® JavaScript Extension Toolkit (JET)
10.0.0

F32683-01

Module:
  • ojknockout-keyset

QuickNav

Description

Creates an observable whose value is a KeySet.

Applications should use ObservableKeySet if they want to track or notify components to changes to a KeySet. ObservableKeySet works just like an observable and it exposes a set of mutation methods that are similar to the ones found in KeySet, which when invoked will update the underlying value in the observable with the updated KeySet. This gives applications a convenient way to directly update KeySets which are designed to be immutable.


Usage

Signature:

class ObservableKeySet<K>

Generic Parameters
ParameterDescription
KType of Key
Typescript Import Format
//To import this class, use the format below.
import {ObservableKeySet} from "ojs/ojknockout-keyset";

For additional information visit:


Constructor

new ObservableKeySet(initialValue)

Creates an observable whose value is a KeySet.
Parameters:
Name Type Argument Description
initialValue KeySetImpl.<K> | AllKeySetImpl.<K> <optional>
The KeySet to observe.

Methods

add(keys) : {ObservableKeySet.<K>}

Equivalent to the add method on KeySet. Calls add method on the underlying KeySet and updates the observable with the returned KeySet.
Parameters:
Name Type Description
keys Set<K> | Array<K> a set of keys to add to this KeySet.
Returns:
this observable KeySet.
Type
ObservableKeySet.<K>

addAll : {ObservableKeySet.<K>}

Equivalent to the addAll method on KeySet. Calls addAll method on the underlying KeySet and updates the observable with the returned KeySet.
Returns:
this observable KeySet.
Type
ObservableKeySet.<K>

clear : {ObservableKeySet.<K>}

Equivalent to the clear method on KeySet. Calls clear method on the underlying KeySet and updates the observable with the returned KeySet.
Returns:
this observable KeySet.
Type
ObservableKeySet.<K>

delete(keys) : {ObservableKeySet.<K>}

Equivalent to the delete method on KeySet. Calls delete method on the underlying KeySet and updates the observable with the returned KeySet.
Parameters:
Name Type Description
keys Set<K> | Array<K> a set of keys to remove from this KeySet.
Returns:
this observable KeySet.
Type
ObservableKeySet.<K>