Skip to content

Instantly share code, notes, and snippets.

@CodisRedding
Last active August 29, 2015 14:06
Show Gist options
  • Save CodisRedding/ec7869c92af881759888 to your computer and use it in GitHub Desktop.
Save CodisRedding/ec7869c92af881759888 to your computer and use it in GitHub Desktop.
Can I promisify @ in coffeescript?
Promise = require 'bluebird'
module.exports =
class Dog
_size: null
_remains: null
constructor: (size) ->
_size = size
Promise.promisify(@)
_kill: ->
@_implodeAsync(_remains)
.then(@_explode)
.catch (e) ->
console.error e
_implode: (remains) ->
# gross stuff
remains
_explode: (remains) ->
# gross stuff
remains
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment