1.5.4 • Published 8 years ago

vigour-stamp v1.5.4

Weekly downloads
21
License
ISC
Repository
github
Last release
8 years ago

vigour-stamp

Build Status js-standard-style npm version Coverage Status

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