David Khourshid
@davidkpiano
University JS @ Cloudspace
Easier to spell
This is a Rey
[1, 2, 3, 4].map(x => x * 2);
// [2, 4, 6, 8]
[1, 2, 3, 4].filter(x => x % 2 == 0);
// [2, 4]
[[1], [2, 3], [], 4].concatAll();
// [1, 2, 3, 4]
[[1], [2, 3], [], 4]
.concatAll() // [1, 2, 3, 4]
.filter(x => x % 2 == 0) // [2, 4]
.map(x => x * 2) // [4, 8]
"Event Streams"
"Streams"
or whatever.
// Array
[1, 2, 3, 4]
// Observable
--1----2--3----4-|->
We can "listen", or subscribe to a stream with three functions:
(no one else calls it that)
--1---2------3--4-->
(filter x => x % 2 == 0)
------2---------4-->
(map x => x * 2)
------4---------8-->
New stream!
New stream!
It'll catch on.