Hi Yishay, yes we'll do the global function.
About a case, for example listening to "initComplete" and then in the handler want to remove the listener. That and other similar cases are very normal if you want to ensure you don't leave listeners hanging and by that way instances not garbage collected. I found that situation very often, so normal that Hugo caught and asked it. Anyway I think we have consensus on the resolution :) El mar., 20 oct. 2020 a las 19:04, Yishay Weiss (<[email protected]>) escribió: > Most of the times I just implement IBead rather than extending Bead.as and > I’m not sure how much it is being used, but it should probably be kept > small. I personally have not needed unlistenOnStrand. Hugo & Carlos, when > was this necessary for you guys? > > > if we have listenOnStrand, shouldn't we also have unlistenOnStrand ? > > Not necessarily. I think we should provide the minimal interface that is > good enough for the most common use cases. > > As I see it, a solution that does not compromise PAYG is to create > function class unlistenOnStrand which can be imported if need be. > > From: hferreira<mailto:[email protected]> > Sent: Tuesday, October 20, 2020 11:20 AM > To: [email protected]<mailto:[email protected]> > Subject: Re: Added helper function on Bead.as to make beads cleaner > > Hi, > > What do you thing about adding this to Bead.as ? > > /** > * Helper function to remove event listener without the need for > casting > * @royaleignorecoercion org.apache.royale.events.IEventDispatcher > */ > protected function > > unlistenOnStrand(eventType:String,handler:Function,capture:Boolean=false):void > { > (_strand as IEventDispatcher).removeEventListener(eventType, handler, > capture); > } > > I know that Bead.as should be keep simple but if we have listenOnStrand, > shouldn't we also have unlistenOnStrand ? > > > > -- > Sent from: http://apache-royale-development.20373.n8.nabble.com/ > > -- Carlos Rovira Apache Member & Apache Royale PMC *Apache Software Foundation* http://about.me/carlosrovira
