1.2.0 • Published 1 year ago

singleton-dom-events v1.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
1 year ago

singleton-dom-events npm version js-standard-style

DOM event manager that strictly allows one event per identifier. It simply stores the elements and callbacks based on the passed identifier and ensures they are removed before (re-)adding them.

install

npm i singleton-dom-events --save

api / function signature

  • identifier (String unique identifier for event - required)
  • element (DOM element - required)
  • eventName (String - required)
  • callback (Function - required)
  • useCapture (Boolean - optional)

usage

Example

const setEvent = require('singleton-dom-events')

let myCb = => console.log('yay')

setEvent('window-resize', window, 'resize', myCb)
setEvent.remove('window-resize')
1.2.0

1 year ago

1.1.1

2 years ago

2.0.0

4 years ago

1.1.0

4 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago