Class: ObservableKeySet

Oracle® JavaScript Extension Toolkit (JET)
7.1.0

F18183-01

Signature:

class ObservableKeySet<K>

QuickNav


ObservableKeySet

Version:
  • 7.1.0
Module:
  • ojknockout-keyset

Module usage

See JET Module Loading for an overview of module usage within JET.

Javascript Import Format
define(['ojs/ojknockout-keyset'], function(ObservableKeySet) {
 // Application should call API on ObservableKeySet 
})
Typescript Import Format
//To import this class, use the format below.
import {ObservableKeySet} from "ojs/ojknockout-keyset";
Generic Parameters
ParameterDescription
KType of Key

JET In Typescript

A detailed description of working with JET elements and classes in your typescript project can be found at: JET Typescript Usage.

Description

Observable implementation of KeySet that keeps track of mutation of KeySet. Since KeySet is immutable, all mutation methods return a new KeySet, and therefore applications must update the associated attribute with the new KeySet. The ObservableKeySet provides a convenient way for applications to mutate the KeySet directly without the need to update the associated attribute.

Constructor

new ObservableKeySet(initialValue)

Create an observable version of a KeySet.
Parameters:
Name Type Argument Description
initialValue KeySetImpl.<K> | AllKeySetImpl.<K> <optional>
The KeySet to observe.

Methods

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

Updates the observable with a KeySet that includes the specified keys.
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>}

Updates the observable with a KeySet that has all keys.
Returns:
this observable KeySet.
Type
ObservableKeySet.<K>

clear() → {ObservableKeySet.<K>}

Updates the observable with a KeySet that contains no keys.
Returns:
this observable KeySet.
Type
ObservableKeySet.<K>

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

Updates the observable with a KeySet that excludes the specified keys.
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>