create project
This commit is contained in:
25
kitabcitab/node_modules/next/dist/shared/lib/mitt.js
generated
vendored
Normal file
25
kitabcitab/node_modules/next/dist/shared/lib/mitt.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = mitt;
|
||||
function mitt() {
|
||||
const all = Object.create(null);
|
||||
return {
|
||||
on (type, handler) {
|
||||
(all[type] || (all[type] = [])).push(handler);
|
||||
},
|
||||
off (type, handler) {
|
||||
if (all[type]) {
|
||||
all[type].splice(all[type].indexOf(handler) >>> 0, 1);
|
||||
}
|
||||
},
|
||||
emit (type, ...evts) {
|
||||
(all[type] || []).slice().map((handler)=>{
|
||||
handler(...evts);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=mitt.js.map
|
||||
Reference in New Issue
Block a user