Last active
September 27, 2017 23:08
-
-
Save superMDguy/a4726f25b799aeecbb696a58a47299f6 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
const data = { | |
name: 'World', | |
feeling: 'like' | |
} | |
walk(data) // adds reactivity to the data object | |
new Watcher( | |
() => `Hello, ${data.name}. I ${data.feeling} Vue.js.`, // the value getter we're watching | |
(val, oldVal) => console.log(val) // the callback, fired on changes to dependencies of the value getter | |
) // logs 'Hello, World. I like Vue.js' | |
data.name = 'Universe' // logs 'Hello, Universe. I like Vue.js' | |
data.feeling = 'love' // logs 'Hello, Universe. I love Vue.js' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment