Napoleonic Political Magnificence

    @totallyinformation/ti-common-event-handler

    1.0.0 • Public • Published

    ti-common-event-handler

    A common, shared event handler used across multiple TotallyInformation packages. Implemented as a singleton class.

    Uses the enhanced EventEmitter2 library for improved performance and support of wildcards

    Installation

    npm install @totallyinformation/ti-common-event-handler

    Use as

    const tiEvents = require('@totallyinformation/ti-common-event-handler')
    
    const aDataVar = {
        some: 'data'
    }
    
    tiEvents.emit('my-event-name', aDataVar)
    
    tiEvents.on('my-event-name', (data) => {
        console.log('My data: ', data)
    })

    Event name wildcards

    * and ** can be used as wildcards when creating event listeners.

    / is pre-configured as the namespace separator so as to match the equivalent in MQTT topics.

    See the EventEmitter2 node for details.

    Current usage

    Dependencies

    Install

    npm i @totallyinformation/ti-common-event-handler

    DownloadsWeekly Downloads

    265

    Version

    1.0.0

    License

    Apache-2.0

    Unpacked Size

    31 kB

    Total Files

    7

    Last publish

    Collaborators

    • totallyinformation