listState creates a reactive list of values that can be used with tags to manage dynamic and reactive apps. It wraps each item with a State (aka. IObservable) to allow for individual item reactivity.
listState
The reactive list of items. Each item is wrapped in a State to allow for individual reactivity.
The raw list of items.
https://github.com/nombrekeff/cardboard-js/wiki/ListState
const myList = listState([1, 2, 3]);myList.add(4);myList.addAt(0, 0);myList.remove(2);myList.removeWhere(item => item === 3);const listValues = myList.listValue;const listLength = myList.length;// Listen to changes in the listmyList.list.changed(() => { // List has changed}); Copy
const myList = listState([1, 2, 3]);myList.add(4);myList.addAt(0, 0);myList.remove(2);myList.removeWhere(item => item === 3);const listValues = myList.listValue;const listLength = myList.length;// Listen to changes in the listmyList.list.changed(() => { // List has changed});
listState
creates a reactive list of values that can be used with tags to manage dynamic and reactive apps. It wraps each item with a State (aka. IObservable) to allow for individual item reactivity.