2 ms·
The concept of tracking data is actually quite simple — when you define some object property as observable it is replaced with a getter & setter that invoke a c
by ikido 11y ago
The concept of tracking data is actually quite simple — when you define some object property as observable it is replaced with a getter & setter that invoke a callback when you get/set that property. Then you can bind a function that will be called when data is changed (via setter).
You can also wrap some code into special autorun function, that will track what observable data was accessed, and when that data changes, that code will be called again.
But wait, there's more =) It works with arrays, objects and other types, check out the docs!
- jarpineh 11y agoThank you. I like the idea of autorun function. Perhaps it could do logging or gathering debug information without having to touch so many places like Redux seems to require.