Skip to content
Myr

example.js

This file

Path

example.js

20 lines · 473 bytes · JavaScript

Last changed by

add example.jstunnckoCorebefore adoption8b4f2de

History of this file

Take it

add example.jstunnckoCorebefore adoption8b4f2de

lines 1–20why, one step back
1'use strict'
23var mitt = require('./dist/mitt')4var ee = mitt()56ee7 .on('*', (type, arg) => console.log('wildcard:', type, arg))8 .on('foo', (one, two, three) => console.log('foo1:', one, two, three))9 .on('foo', (one, two, three) => console.log('foo2:', one, two, three))10 .on('bar', (arg) => console.log('bar:', arg))11 .emit('foo', 1, 2, 3)12 .emit('bar', 444)1314console.log(ee.all)1516var emitter = mitt()1718console.log(emitter.all) // => {}1920emitter.emit('foo', 777)