How to use the ev-emitter.prototype function in ev-emitter

To help you get started, we’ve selected a few ev-emitter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oncode / handorgel / src / js / index.js View on Github external
_bindEvents() {
    this._listeners.resize = this._handleResize.bind(this)
    window.addEventListener('resize', this._listeners.resize)

    this._listeners.foldOpen = this._handleFoldOpen.bind(this)
    this.on('fold:open', this._listeners.foldOpen)
  }

  _unbindEvents() {
    window.removeEventListener('resize', this._listeners.resize)
    this.off('fold:open', this._listeners.foldOpen)
  }
}

// extend the prototype manually to fix IE10
extend(Handorgel.prototype, EventEmitter.prototype)

Handorgel.defaultOptions = {
  keyboardInteraction: true,
  multiSelectable: true,
  ariaEnabled: true,
  collapsible: true,
  carouselFocus: true,

  initialOpenAttribute: 'data-open',
  initialOpenTransition: true,
  initialOpenTransitionDelay: 200,

  headerOpenClass: 'handorgel__header--open',
  contentOpenClass: 'handorgel__content--open',

  headerOpenedClass: 'handorgel__header--opened',

ev-emitter

lil' event emitter

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis

Popular ev-emitter functions