example.js
This file
Path
example.js
20 lines · 485 bytes · JavaScript
Last changed by
update example.jstunnckoCorebefore adoption6a9154a
History of this fileTake it
add example.jstunnckoCorebefore adoption8b4f2de
lines 1–6why, one step back1'use strict'23var mitt = require('./dist/mitt')4var ee = mitt()56eeadd editorconfig, fix original identationtunnckoCorebefore adoptione7c222c
line 7why, one step back7 .on('*', (type, arg) => console.log('wildcard:', type, arg))update example.jstunnckoCorebefore adoption6a9154a
lines 8–11why, one step back8 .on('foo', (one, c) => console.log('foo1:', one)) // => 19 .on('foo', (one) => console.log('foo2:', one)) // => 110 .on('bar', (arg) => console.log('bar:', arg)) // => 44411 .emit('foo', 1, 2, 3) // we not support multiple argumentsadd editorconfig, fix original identationtunnckoCorebefore adoptione7c222c
line 12why, one step back12 .emit('bar', 444)add example.jstunnckoCorebefore adoption8b4f2de
lines 13–20why, one step back1314console.log(ee.all)1516var emitter = mitt()1718console.log(emitter.all) // => {}1920emitter.emit('foo', 777)