Skip to content

Instantly share code, notes, and snippets.

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