File: foo-singleton.js

package info (click to toggle)
node-proxyquire 2.1.3%2B~1.0.1%2B~1.0.2-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 512 kB
  • sloc: javascript: 1,352; perl: 39; makefile: 33; sh: 6
file content (10 lines) | stat: -rw-r--r-- 172 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
function FooSingleton () { }

var instance = null
exports.getInstance = function () {
  if (instance === null) {
    instance = new FooSingleton()
  }

  return instance
}