funcs-invoker

0.2.0 • Public • Published

funcs-invoker

WHY a event emitter need a event name ?!

import { FuncsInvoker } from "event-invoker";

const invoker = new FuncsInvoker<[string, string]>();
invoker.on((a, b) => {
    // this is a InvokeContext object.
    // a === 'a'
    // b === 'b'
    return 'ret_1';
});
invoker.on((a, b) => {
    // this is a InvokeContext object.
    // a === 'a'
    // b === 'b'
    return 'ret_2';
});
invoker.invoke('a', 'b'); // return 'ret_2'

Readme

Keywords

none

Package Sidebar

Install

npm i funcs-invoker

Weekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

54.3 kB

Total Files

12

Last publish

Collaborators

  • cologler