Skip to content


Subversion checkout URL

You can clone with
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 "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.