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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -