UNPKG

@blocknote/core

Version:

A "Notion-style" block-based extensible text editor built on top of Prosemirror and Tiptap.

3 lines (2 loc) 614 B
"use strict";var h=Object.defineProperty;var b=(c,s,l)=>s in c?h(c,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):c[s]=l;var t=(c,s,l)=>b(c,typeof s!="symbol"?s+"":s,l);class k{constructor(){t(this,"callbacks",{})}on(s,l){return this.callbacks[s]||(this.callbacks[s]=[]),this.callbacks[s].push(l),()=>this.off(s,l)}emit(s,...l){const a=this.callbacks[s];a&&a.forEach(i=>i.apply(this,l))}off(s,l){const a=this.callbacks[s];a&&(l?this.callbacks[s]=a.filter(i=>i!==l):delete this.callbacks[s])}removeAllListeners(){this.callbacks={}}}exports.EventEmitter=k; //# sourceMappingURL=EventEmitter-CLwfmbqG.cjs.map