Cargando…

Mastering Immutable.js.

Chapter 2: Creating Immutable Data; Immutable.js constructors; The types of Immutable.js data; Lists; Maps; Ordered maps; Sets; Ordered sets; Sequences; Stacks; Records; Passing JavaScript collections; Passing Immutable.js collections; Using the of() method; Lists of values; Maps of values; Sets of...

Descripción completa

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Boduch, Adam
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birmingham, UNKNOWN : Packt Publishing, 2017.
Temas:
Acceso en línea:Texto completo
Tabla de Contenidos:
  • Cover; Title Page; Copyright; Credits; About the Author; About the Reviewer; www.PacktPub.com; Customer Feedback; Table of Contents; Preface; Chapter 1: Why Immutable.js?; Mutations are destructive; Deleting old data; A scary class of bugs; Persisting changes; The Immutable.js approach; A collections API; Collection methods return new data; Chaining method calls; Unidirectional data flow; What other direction is there?; Subscriptions are out; Data is only created; Implicit side-effects are hard to do; Other libraries similar to Immutable.js; What are we comparing?; Lodash is a good bet.
  • Chaining value insertion methodsPushing multiple list values; Adding multiple map key-value pairs; Changing collection values; Changing list values; Setting list values; Updating list values; Changing map values; Setting map values; Updating map values; Chaining collection mutation methods; Removing values from collections; Removing values from lists; Removing values from maps; Chaining collection removal methods; Emptying collections; Replacing collections with new instances; Using the clear() method; Keeping track of changes; Summary; Chapter 4: Filtering Collections and Finding Items.
  • Filtering using simple comparisonsStrict equality; Greater than and less than; Filtering by negation; Filtering maps by keys; Filtering string keys; Filtering fancy keys; Finding collection values; Value existence checks; Getting values using find(); Filtering using deep equality; Using the is() function and the equals() method; Searching lists of maps; Partial matches; The shape of maps; Subsets and supersets; Changing the search direction; Searching sorted collections; Using findLast() and reduceRight(); Summary; Chapter 5: Sequences and Side-Effects; Why lazy evaluation?
  • Large collections are expensiveAvoiding unnecessary work; Chained operations are easy to understand; Sequence creation and iteration; Basic sequence creation; Collections to sequences; Lists to sequences; Maps to sequences; Iterating with for ... of loops; Iterating with forEach(); Lazy filtering; Basic lazy filtering; Multiple filter levels; Limiting results and reducing work; Using take() to limit results; Using slice() to paginate; Summary; Chapter 6: Sorting Collections; Sorting and reversing; The sort() method; The reverse() method; Sorting lists of maps; The sortBy() method.