Upload
bryan-anderson
View
467
Download
5
Embed Size (px)
Citation preview
ENHANCING USER EXPERIENCES WITH REACTIVE EXTENSIONS
Bryan Anderson
What is Rx?
Reactive Extensions are a set of extension methods that allow you
to compose and operate on streams with LINQ operators in the same way you would a list.
Compose and operate on streams? Sounds like it’s time
for me to take a nap.
Streams?
A stream can be thought of as a list of events that take place over
time.
Compose?
Sticking functions together, like Legos. Say we have two functions
f and g.Math: f(g(x))Unix: x | g | f
What is Rx?
Reactive Extensions are a set of extension methods that allow you
to compose and operate on streams with LINQ operators in the same way you would a list.
It’s too early to think abstractly and a nap sounds
really good right now.
IObservable vs IEnumerable
IObservable and IEnumerable are mathematical duals. Which just means they’re equivalent. Every IEnumerable could be turned into
an IObservable and vice-versa (with enough time).
If they’re equivalent what does IObservable give us?
IObservable vs IEnumerable
IEnumerable let’s you pull items from it.
IObservable pushes items to you.
IObservable vs IEnumerable
When it comes down to it
IObservable = IEnumerable + Time
Marble Diagrams
Running observable:Completed normally:Completed with an exception:
Input goes above output:
I think you’ve lost your marbles.
Questions so far?
Please feel free to ask questions as we go.
The LINQ you’re used to
Common LINQ queries work the same Select Where First Skip Take
Time adds more options
Throttle Delay BufferWithTime, BufferWithCount Scan Zip, Merge, CombineLatest
Dude, this is a CODE camp. You need to stop talking and
show me some code!