Overview
Syllabus
Intro
Persistent Immutable Data Structures
Structural Sharing
Directed Acyclic Graph
reTrieve
Index Trie
Implementation as Trie, Interface as Lists and Maps!
The Hash Array Mapped Trie (HAMT) is based on the simple notion of hashing a key and storing the key in a trie based on this hash value.
Simplicity is hard work. But there's a huge payoff. The person who has a genuinely simpler system is going to be able to affect the greatest change with the least work. He's going to kick your ass.
What problems does this solve anyway?
Concurrency, No locks!
Multithreading: There be dragons.
JavaScript is in trouble.
Embracing Immutability enables JavaScript's future.
Mutable objects complect Time and Value
var identity; identity = "value"; identity = "next value"
Immutable data removes complexity.
The Many Mutators Problem.
What changed?
Dirty bits
UI Framework coupling model class to view class.
Immutable change tracking
Memoization
shouldComponentUpdate()
Immutable Data is Faster
Reconciliation is pretty damn fast.
Reconciliation is slower than persistent data.
Flux stores contain mutable data.
Reconciliation is pretty damn fast?
Flux stores with immutable data!
Flux store is an identity New immutable values as time passes
Bonus: Undo is easy!
No more mutable state stockholm syndrome.
Solve problems by removing complexity.
Taught by
Meta Developers