Nth Phonetic Mnemonic

    nv-facutil-event

    1.0.0 • Public • Published

    nv-facutil-event

    install

    • npm install nv-facutil-event

    USAGE

    const fac_event = require("nv-facutil-event")
    var ET = fac_event.creat_event_target_cls("Guard-a")
    var et = new ET();
    et.addEventListener("foo", function(e) {console.log(e.data)})
    et.addEventListener("bar", function(e) {console.log(e.data)})
    > et.ls()
    Map(2) {
      'foo' => [Function (anonymous)],
      'bar' => [Function (anonymous)]
    }
    >
    > var efoo =  et.dispatch("foo",{detail:100})
    { detail: 100 }
    > var ebar = et.dispatch("bar",{detail:200})
    { detail: 200 }
    >
    
    
    var E = fac_event.creat_event_cls("click")
    var e = new E('foo',[1,2,3,4])
    > e
    Click {
      type: 'foo',
      defaultPrevented: false,
      cancelable: false,
      timeStamp: 427991.7643392086
    }
    > e.data
    [ 1, 2, 3, 4 ]
    >
    > et.dispatchEvent(e)
    [ 1, 2, 3, 4 ]
    true
    >
    

    APIS

    • creat_event_cls(name)
    • E
    • creat_event_target_cls(name)
    • ET

    LICENSE

    • ISC

    Keywords

    none

    Install

    npm i nv-facutil-event

    DownloadsWeekly Downloads

    38

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    2.46 kB

    Total Files

    3

    Last publish

    Collaborators

    • ihgazni2