-
Notifications
You must be signed in to change notification settings - Fork 0
Cookbook: track
Eugene Lazutkin edited this page Nov 26, 2019
·
3 revisions
In order to use io.track
make sure that it is enabled:
// activate the package
io.track.attach();
See How to include for more details. See track for the full documentation.
We can register an interest in an I/O request without initiating it:
// register for a value
io.get({
url: '/url',
wait: true
}).then(function (value) {
console.log('Delayed value:', value);
});
// ...
// now we request it
io.get('/url').then(function (value) {
console.log('Got value:', value);
});
// eventually it will print two lines:
// Delayed value: 42
// Got value: 42