Lambda calculus expansions are cool.

Lambda calculus expansions are cool.

The reduceRight() array operator can be defined by pattern matching one of these two cases:

[ ].reduceRight(f, acc) → acc

[x, … xs].reduceRight(f, acc) → f(xs.reduceRight(f, acc), x)

i.e. An empty array right reduces simply to the value of its accumulator.

A non-empty array right reduces to its function being applied to a right reduction of its tail with its head being used as the accumulator.

Redux requires a new state to be created on every update of the store.

Redux requires a new state to be created on every update of the store. The usual, cheapest way to do this is by shallow copying the state to create a new state.

Andrea Giammarchi developed a different way in which the new store is prototypically inherited from the previous state. This library is significantly faster than shallow copying, especially when the number of keys in the store grows large. It also has features for managing depth and compressing the state from time to time.