@scalar/api-client
Version:
the open source API testing client
33 lines (32 loc) • 474 B
JavaScript
function s() {
const e = /* @__PURE__ */ new Set();
function r(n) {
return e.add(n), () => o(n);
}
function f(n) {
function t(...i) {
o(t), n(...i);
}
return r(t);
}
function o(n) {
e.delete(n);
}
function c() {
e.clear();
}
function u(n) {
e?.forEach((t) => t(n));
}
return {
on: r,
once: f,
off: o,
emit: u,
reset: c,
listeners: () => Array.from(e)
};
}
export {
s as createEventBus
};