notification-server
Version:
Based on NowJS, a standalone server for sending and receiving notification across different live users
33 lines (23 loc) • 510 B
text/coffeescript
class Storage
constructor: ->
= {}
= []
_generateUID: ->
(new Date().getTime() * 6000 * Math.random()).toString().replace('.', '')
add: (object) ->
uid = ()
[uid] = object
.push uid
uid
size: ->
.length
remove: (uid) ->
if (uid)
delete [uid]
.splice(.indexOf(uid), 1)
exist: (uid) ->
uid in
reset: ->
= []
= []
exports.Storage = Storage