Wondering what’s next for npm?Check out our public roadmap! »

    @zhishaofei3/eventdispatcher

    1.1.3 • Public • Published

    ES6 EventDispatcher

    Code Example

    import EventDispatcher from "@zhishaofei3/eventdispatcher"
     
    class MyClass extends EventDispatcher {
    }
     
    const myClass  = new MyClass()
     
    function onEventHandler() {
    }
     
    // API
    myClass.addEventListener('eventName', onEventHandler)
    myClass.hasEventListener('eventName', onEventHandler) // true
    myClass.dispatchEvent('eventName')
    myClass.removeEventListener('eventName', onEventHandler)
    myClass.removeAllEventListener()

    Install

    npm i @zhishaofei3/eventdispatcher

    DownloadsWeekly Downloads

    2

    Version

    1.1.3

    License

    ISC

    Unpacked Size

    6.33 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar