Skip to content

Instantly share code, notes, and snippets.

@Raynos

Raynos/tsov.js Secret

Created March 16, 2013 00:56
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 Raynos/5a7ca9852ac0d8c5f3e1 to your computer and use it in GitHub Desktop.
Save Raynos/5a7ca9852ac0d8c5f3e1 to your computer and use it in GitHub Desktop.
function tsov() {
var emitter = new EventEmitter()
setInterval(function () {
emitter.emit("data", Date.now())
}, 1000)
return emitter
}
function vot() {
var emitter = new EventEmitter()
var value = Date.now()
setInterval(function () {
value = Date.now()
emitter.emit("data", value)
})
emitter.valueOf = function () { return value }
return emitter
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment