mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 08:52:34 +00:00
Components added. Build issues fixed
This commit is contained in:
parent
5b66ed1093
commit
18c3721848
344 changed files with 12446 additions and 8758 deletions
|
@ -1,29 +1,32 @@
|
|||
export default function primebus() {
|
||||
const allHandlers = new Map();
|
||||
const allHandlers = new Map();
|
||||
|
||||
return {
|
||||
on(type, handler) {
|
||||
let handlers = allHandlers.get(type);
|
||||
if (!handlers)
|
||||
handlers = [handler];
|
||||
else
|
||||
handlers.push(handler);
|
||||
return {
|
||||
on(type, handler) {
|
||||
let handlers = allHandlers.get(type);
|
||||
|
||||
if (!handlers) handlers = [handler];
|
||||
else handlers.push(handler);
|
||||
|
||||
allHandlers.set(type, handlers);
|
||||
},
|
||||
},
|
||||
|
||||
off(type, handler) {
|
||||
let handlers = allHandlers.get(type);
|
||||
if (handlers) {
|
||||
handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
||||
}
|
||||
},
|
||||
|
||||
emit(type, evt) {
|
||||
off(type, handler) {
|
||||
let handlers = allHandlers.get(type);
|
||||
|
||||
if (handlers) {
|
||||
handlers.slice().map((handler) => { handler(evt);});
|
||||
handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
emit(type, evt) {
|
||||
let handlers = allHandlers.get(type);
|
||||
|
||||
if (handlers) {
|
||||
handlers.slice().map((handler) => {
|
||||
handler(evt);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue