import IBindableSet from "jwidget/IBindableSet";
Extension of DestroyableReadonlyBindableSet with modification methods.
readonly silent: boolean
readonly size: Bindable<number>
readonly native: ReadonlySet<T>
readonly onSplice: Listenable<IBindableSet.SpliceResult<T>>
readonly onClear: Listenable<ReadonlySet<T>>
readonly onChange: Listenable<void>
(): this
Makes this set an owner of its values, which means that its values are alive as long as they are present in this set. A value is destroyed when it leaves the set, and all values are destroyed on the set destruction.
(value: T): boolean
Adds a value to the set if one is absent and dispatches onSplice message.
(values: Iterable<T>): ReadonlySet<T>
Adds multiple values to the set, ones that are absent, and dispatches onSplice message.
(value: T): boolean
Deletes a value from the set if one is present and dispatches a onSplice message.
(values: Iterable<T>): ReadonlySet<T>
Deletes multiple values from the set, ones that are present, and dispatches onSplice message.
(): ReadonlySet<T>
Deletes all values from the set and dispatches onClear message.
(valuesToDelete: Iterable<T>, valuesToAdd: Iterable<T>): IBindableSet.SpliceResult<T>
Deletes and/or adds multiple values in the set granularly and dispatches onSplice message.
(values: Iterable<T>): ReadonlySet<T>
Adds multiple values to the set, ones that are absent, and dispatches onSplice message.
(values: Iterable<T>): ReadonlySet<T>
Deletes multiple values from the set, ones that are present, and dispatches onSplice message.
(): ReadonlySet<T>
Deletes all set values and dispatches onClear message.
(valuesToDelete: Iterable<T>, valuesToAdd: Iterable<T>): IBindableSet.SpliceResult<T>
Deletes and/or adds multiple values in the set granularly and dispatches onSplice message.
Adjusts the set contents to newContents using detectSplice and splice methods.
(): void
Class destructor. You must override it in a subclass and call this method explicitly from outside, because JavaScript doesn't support automatic class destructor calling.
const object = new MyClass(); // ... // When the object is not needed anymore, destroy it. object.destroy();
Alternatively (and optimally), you should use own method to aggregate this object in another one.
(): IterableIterator<T>
(value: T): boolean
(callback: (value: T) => void): void
Iterates through the collection items. Calls the specified function for all values.
(newContents: Iterable<T>): IBindableSet.SpliceParams<T>
Detects splice method arguments to adjust the set contents to newContents. Determines values to be deleted and added.
<T extends Destroyable>(obj: T): T
Aggregates the object. It means that the specified object is automatically destroyed
on this
object destruction. The aggregated objects are destroyed in reverse order.
Returns obj object, which makes it easy to use in field definition:
private selected = this.own(new Property(false));
(obj: Destroyable): this
The same as own, but returns this
, which makes it easy to use in object instantiation:
const items = new BindableArray().ownValues(); return new Panel(items).owning(items);
IBindableSet.splice method arguments. Result of detectSplice method.
IBindableSet.splice method result.
readonly deletedValues: ReadonlySet<T>
readonly addedValues: ReadonlySet<T>