vigour-stamp
v1.5.4
Published
generates unique stamps for changes, possiblity to observe progress of stamps
Downloads
41
Readme
vigour-stamp
Generates unique stamps for change, listens to close events
const vstamp = require('vigour-stamp')
// vstamp.create(type, source, override)
// results in click-1
const stamp = vstamp.create('click')
// fires when a stamp closes (is handled)
vstamp.on(stamp, () => console.log('closing'))
// fires after on listeners, when a stamp closes
vstamp.done(stamp, () => console.log('closed'))
// fires the onclose listener
vstamp.close(stamp)
const parsed = vstamp.parse(stamp)
// returns a parsed stamp { type: 'click', val: 1 }
// remove all listeners
vstamp.remove(stamp)
// to debug use
const debug = require('vstamp/debug')
debug(vstamp)
// this will throw errors when stamps are created while others are still open