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

  1. trigger event name (a) in function in class,
  2. capture event name (a) in same class,
  3. and dispatch function in class,
  4. 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

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -