mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
throw error if missing callback in event bus
This commit is contained in:
@@ -35,6 +35,9 @@ export class EventBus {
|
||||
* listener.
|
||||
*/
|
||||
on(eventType: string, owner: any, callback: Callback) {
|
||||
if (!callback) {
|
||||
throw new Error("Missing callback");
|
||||
}
|
||||
if (!this.subscriptions[eventType]) {
|
||||
this.subscriptions[eventType] = [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user