Skip to content

Instantly share code, notes, and snippets.

@blackcoat
Created May 29, 2014 16:11
Show Gist options
  • Save blackcoat/a8e9e2f27b385198d6bd to your computer and use it in GitHub Desktop.
Save blackcoat/a8e9e2f27b385198d6bd to your computer and use it in GitHub Desktop.
Singleton Pattern
class Singleton
instance = null
@get = ->
instance ?= value
module.exports = Singleton.get()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment