Skip to content

Instantly share code, notes, and snippets.

@demosifter
Last active October 11, 2016 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save demosifter/de87922e6a3c3b15d32e5c8b578ea2a5 to your computer and use it in GitHub Desktop.
Save demosifter/de87922e6a3c3b15d32e5c8b578ea2a5 to your computer and use it in GitHub Desktop.
//...
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