funcs-invoker
v0.2.0
Published
[![](https://data.jsdelivr.com/v1/package/gh/Cologler/funcs-invoker-typescript/badge)](https://www.jsdelivr.com/package/gh/Cologler/funcs-invoker-typescript)
Downloads
8
Readme
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'