Domande taggate «immutable.js»

3
Indice all'interno della funzione map ()
Mi manca un'opzione su come ottenere il numero indice all'interno della mapfunzione utilizzando Listda Immutable.js: var list2 = list1.map(mapper => { a: mapper.a, b: mapper.index??? }).toList(); La documentazione mostra che map()ritorna Iterable<number, M>. Esiste un modo elegante per ciò di cui ho bisogno?


7
Come aggiornare l'elemento all'interno di List con ImmutableJS?
Ecco cosa hanno detto i documenti ufficiali updateIn(keyPath: Array<any>, updater: (value: any) => any): List<T> updateIn(keyPath: Array<any>, notSetValue: any, updater: (value: any) => any): List<T> updateIn(keyPath: Iterable<any, any>, updater: (value: any) => any): List<T> updateIn(keyPath: Iterable<any, any>, notSetValue: any, updater: (value: any) => any): List<T> Non è possibile che un …
Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.