UNPKG

@exceptionless/fetchclient

Version:

A simple fetch client with middleware support for Deno and the browser.

16 lines (15 loc) 326 B
export class ObjectEvent { handlers = []; on(handler) { this.handlers.push(handler); } off(handler) { this.handlers = this.handlers.filter((h) => h !== handler); } trigger(data) { this.handlers.slice(0).forEach((h) => h(data)); } expose() { return this; } }