Skip to content

Instantly share code, notes, and snippets.

@yashke
Created February 3, 2012 00:01
Show Gist options
  • Save yashke/1726615 to your computer and use it in GitHub Desktop.
Save yashke/1726615 to your computer and use it in GitHub Desktop.
Usecase
class ServerSide
createToken: (callback) =>
# asynchronously get token from server and do:
callback(token)
class SomeUsecase
constructor: (@serverSide) ->
execute: (name) =>
@serverSide.createToken((token) => @doSmthWith(token, name))
doSmthWith: (token, name) =>
#blah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment