Meteor Deep Dive
Reactive Programming With Tracker
How does the magic happen?
Warning
This is not the entry level
What is Tracker?
Reactive Programming
a = b + c
How does Tracker do RP?
How does Tracker work its magic?
Do you know an OOP design pattern used to look for changes of an object and notify other objects which subscribe to those changes?
Observer pattern
Publish/subscribe pattern
Let's dive into the code
The flow of Tracker
Tracker.autorun
new Tracker.Computation (call this C)
C sets itself as the global currentComputation and runs for the first time
Subject.depend() is call and add C to its dependents list
Subject.change() will lookup and rerun all dependent computations
Note: that is not the complete Tracker
Computation inside computation
Clear cache
Prevent infinite loop
Thank you
1
Resume presentation
Meteor Deep Dive Reactive Programming With Tracker How does the magic happen?
Made with Slides.com
BESbswy
BESbswy
BESbswy
BESbswy