Skip to content

Instantly share code, notes, and snippets.

@scottharvey
Created October 6, 2011 23:42
Show Gist options
  • Save scottharvey/1269030 to your computer and use it in GitHub Desktop.
Save scottharvey/1269030 to your computer and use it in GitHub Desktop.
# This is close but I to pass chat.module("friend") into the anonymous function
do (Friend) ->
Message = chat.module "message"
app = chat.app
@gabehollombe
Copy link

Maybe... ?

(do (Friend) ->
Message = chat.module("message")
app = chat.app
)(chat.module('friend'))

@gabehollombe
Copy link

Or, rather

( (Friend) -> do (Friend) ->
Message = chat.module("message")
app = chat.app
)(chat.module('friend'))

@scottharvey
Copy link
Author

That's pretty much what the first revision looks like which was generated by js2coffee.org

https://gist.github.com/1269030/37b0ed748b15f856ba1f38e444a6da31869a86f6

It seems that might be the best way to implement the pattern.

Thanks for checking it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment