Last active
October 11, 2016 19:38
-
-
Save demosifter/de87922e6a3c3b15d32e5c8b578ea2a5 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
//... | |
constructor() { | |
// You have to call the super() method to initialize the base class. | |
super(); | |
this.controller.subscribe('counts', this.onCounts.bind(this)); | |
} | |
// for more info: https://docs.redsift.com/docs/client-code-siftview | |
presentView(value) { | |
console.log('counter: presentView: ', value); | |
this.onCounts(value.data); | |
}; | |
willPresentView(value) { | |
console.log('counter: willPresentView: ', value); | |
}; | |
onCounts(data) { | |
console.log('counter: onCounts: ', data); | |
document.getElementById('number').textContent = data.value; | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment