Morglod / plankee

world smallest event emitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

plank event emitter

Smallest was nanoevents but it is 219 minified size and 138 brotlied (not 107!!!)

So why we should waste so much memory in JS?

Real original size 93 bytes
Real broitled size 81 bytes
Broitled size inside app 77 bytes

Usage:

npm i plankee
import { pee } from "plankee";

const [onLog, emitLog] = pee<[text: string]>();

const removeListener = onLog((text) => console.log("log: " + text));

emitLog("hello world!");

removeListener();

API

[subscribe, emit] = pee<[ARGUMENTS]>();

// subscribe returns disposer

About

world smallest event emitter


Languages

Language:TypeScript 67.8%Language:JavaScript 32.2%