Skip to content

Instantly share code, notes, and snippets.

@pewniak747
Last active December 20, 2015 16:08
Show Gist options
  • Select an option

  • Save pewniak747/6159010 to your computer and use it in GitHub Desktop.

Select an option

Save pewniak747/6159010 to your computer and use it in GitHub Desktop.
# define responses
Application.reqres.setHandler "post:new", ->
new Post
Application.reqres.setHandler "post:get", (id) ->
post = new Post(id: id)
post.fetch()
post
# request a response
Application.request("post:get", 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment