<p>onCollectionChange</p><a class="link-doclet-owner-link" data-element="Types/_collection/IObservable" data-path="Types/collection/IObservable">#Types/_collection/IObservable</a>

<p>После изменения коллекции</p>

Примеры

<pre> import {ObservableList, IObservable} from 'Types/collection'; const list = new ObservableList({ items: [1, 2, 3] }); list.subscribe('onCollectionChange', (event, action, newItems, newItemsIndex, oldItems, oldItemsIndex) => { if (action == IObservable.ACTION_REMOVE){ console.log(oldItems); // [1] console.log(oldItemsIndex); // 0 } }); list.removeAt(0); </pre>
11/27/2020Мальцев А.А.