UNPKG
litt
Version:
latest (1.0.2)
1.0.2
1.0.1
1.0.0
The smallest event emitter in the world.
github.com/lf94/litt
lf94/litt
litt
/
index.js
2 lines
(1 loc)
•
152 B
JavaScript
View Raw
1
2
e =
(
a = {}
) =>
({
on
(
t, x
) { a[t] ? a[t].
push
(x) : a[t] = [x] },
off
(
t, x
) { a[t] = a[t].
filter
(
f
=>
f != x) },
emit
(
t, x
) { a[t].
map
(
f
=>
f
(x)) }, })