Created
November 13, 2019 23:12
-
-
Save joshleblanc/9d9509e0d6e33d24fa3e0653112ad772 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main.js:32 var changed 0 | |
main.js:36 Running a === 1 | |
main.js:41 Running a === 2 | |
main.js:45 ---- | |
main.js:32 var changed 1 | |
main.js:36 Running a === 1 | |
main.js:32 var changed 2 | |
main.js:36 Running a === 1 | |
main.js:41 Running a === 2 | |
main.js:32 var changed 3 | |
main.js:41 Running a === 2 | |
main.js:32 var changed 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const v = new ReactiveVar(0); | |
const d = new ReactiveDict({ | |
a: 0 | |
}); | |
Tracker.autorun(() => { | |
console.log("var changed", v.get()); | |
}); | |
Tracker.autorun(() => { | |
console.log("Running a === 1"); | |
d.equals('a', 1) | |
}); | |
Tracker.autorun(() => { | |
console.log("Running a === 2"); | |
d.equals('a', 2) | |
}); | |
console.log("----"); | |
let count = 0; | |
window.setInterval(() => { | |
v.set(count); | |
d.set('a', count); | |
count += 1; | |
}, 5000); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment