Skip to content

Instantly share code, notes, and snippets.

@samueljseay
Last active August 29, 2015 14:15
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 samueljseay/d765c0ec0d804522d42b to your computer and use it in GitHub Desktop.
Save samueljseay/d765c0ec0d804522d42b to your computer and use it in GitHub Desktop.
little better
// You could do this
var RecentProblemsComponent = Y.Base.create('prb-recent-problems-component', Y.View, [Y.OHP.Component], {
initializer: function() {
this.goGetData().then(this.render);
},
render: function() {
if(this.hasSomeData) {
this.hideProgressIndicator();
this.showData;
}
else {
this.showProgressIndicator();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment