Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (21 sloc) 0.679 kb
_ = require "underscore"
program = require "./setup"
module.exports = (event, args, response, handler) ->
unless handler?
handler = response
response = args
args = []
unless _.isArray args
args = [args]
onError = (err) ->
console.log "Error while updating user!"
console.dir err if err?
program.socket.removeListener response, onResponse
program.events.emit "ready"
onResponse = ->
program.socket.removeListener "error", onError
handler.apply this, arguments
program.socket.once "error", onError
program.socket.once response, onResponse
args.unshift event
program.socket.emit.apply program.socket, args
Jump to Line
Something went wrong with that request. Please try again.