Open shrinktofit opened 1 year ago
In discussion with @PPpro , we prefer the on()
style registering:
class A extends EventTarget {
on(type: "event-a", (callback_signature_of_event_a) => void): void;
on(type: "event-b", (callback_signature_of_event_b) => void): void;
on(type: string, callback: (...args: unknown[]) => void) {
super.on(type, callback); // Forward to `super.on`
}
}
@lealzhan please check the event callbacks in physics module @holycanvas please check the event callbacks in 2D & UI module
some developers also have some feedback for event registration on Spine module @zhakesi https://forum.cocos.org/t/topic/148276/64?u=_pp
Re: https://discord.gg/cocos-simplify-game-development-634690911896469525