Skip to content

Instantly share code, notes, and snippets.

@showell
Created January 23, 2012 15:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save showell/1663926 to your computer and use it in GitHub Desktop.
Save showell/1663926 to your computer and use it in GitHub Desktop.
object creation pattern
root = this
$ = jQuery
root.logger = do ($) ->
logContainer = null
write = (msg) ->
logContainer.append("<p>#{msg}</p>")
pub =
init: (el) -> logContainer = el
log: (msg) -> write msg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment