Skip to content

Instantly share code, notes, and snippets.

@aherve
Created December 13, 2016 12:34
Show Gist options
  • Select an option

  • Save aherve/a1c9a7596afad95aa49d106ca9148f06 to your computer and use it in GitHub Desktop.

Select an option

Save aherve/a1c9a7596afad95aa49d106ca9148f06 to your computer and use it in GitHub Desktop.
class Foo {
constructor (name) {
this.name = name
}
greet () {
console.log('hello, this is ', this.name)
}
someThingAsync () {
return Promise.resolve()
}
asyncGreet () {
this.someThingAsync()
.then(this.greet)
}
}
new Foo('dog').asyncGreet()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment