javascript - What's the benefit of re-trigger a custom event to another custom event? -
for example, following code:
this.notifyclosed=function(){this.trigger("uisigninorsignupdialogclosed")}, this.on(this.$node,"uidialogclosed",this.notifyclosed) // <- benefit of calling function forward event event name?
to clarify, event name in second line "uidialogclosed" defined within class (which first line included). so, steps coder doing this
- trigger event name (a) in function in class,
- capture event name (a) in same class,
- and dispatch function in class,
- then trigger event name (b) in class
what's benefit of doing instead of triggering event name (b) in step (1)?
source code reference:
https://abs.twimg.com/c/swift/en/init.c55682c6beb3d82a7317d5287646278649c9e765.js
search 'this.notifyclosed' in above source code. there 2 occurrence in source code. , explains question.
Comments
Post a Comment