@okiba/event-manager

2.1.1 • Public • Published

Okiba / EventManager

A custom events management system

Installation

npm i --save @okiba/event-manager

Or import it directly in the browser

<script type="module" src="https://unpkg.com/@okiba/event-manager/index.js"></script>

Usage

import EventManager from '@okiba/event-manager'

Untranspiled code 🛑

Okiba UI packages are not transpiled, so don't forget to transpile them with your favourite bundler. For example, using Babel with Webpack, you should prevent imports from okiba to be excluded from transpilation, like follows:

{
  test: /\.js$/,
  exclude: /node_modules\/(?!(@okiba)\/).*/,
  use: {
    loader: 'babel-loader',
    options: {
      presets: ['@babel/preset-env']
    }
  }
}

Submodules:

EventManager

A singleton to manage centralized event listeners

subscribedEvents, hasListeners, subscribe, unsubscribe, update, on, off, emit, clear, destroy

AbstractHandler

A base class that defines a global event handler interface

module:AbstractHandler, eventCallback, listen, unlisten, dispatch

EventHandler

An handler class aimed to centralize a native browser event listener

listen, unlisten, dispatch

RAFHandler

An handler class aimed to centralize a requestAnimationFrame

nextFrame, listen, unlisten

Readme

Keywords

none

Package Sidebar

Install

npm i @okiba/event-manager

Weekly Downloads

8

Version

2.1.1

License

MIT

Unpacked Size

238 kB

Total Files

16

Last publish

Collaborators

  • fiad
  • ghzmdr
  • lavolpecheprogramma