vigour-stamp

1.5.4 • Public • Published

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
 

Readme

Keywords

Package Sidebar

Install

npm i vigour-stamp

Weekly Downloads

31

Version

1.5.4

License

ISC

Last publish

Collaborators

  • vigour-io