Copy link to clipboard
Copied
Hi guys
When using responder eg new Responder(onSearchResult, searchFailed) instead of a standard event listener, so you need to remove the Responder in some way once it's complete, as you would an event listener?
If so, how is that done?
Cherers for your help.
I believe a Responder works in more of a singleton means. Just null your reference if it's not scoped. Typically I would scope responder to a class-level object and when I'm cleaning up after my app I simply null the object. You can also sort of anonymously use it in the SQL statements execute as well e.g. mysqlconn.execute(-1, new Responder(someFunction));
Just be careful that no more SQL statements execute if you expected a responder to pick up the update or error or you can encounter a runti
...Copy link to clipboard
Copied
I believe a Responder works in more of a singleton means. Just null your reference if it's not scoped. Typically I would scope responder to a class-level object and when I'm cleaning up after my app I simply null the object. You can also sort of anonymously use it in the SQL statements execute as well e.g. mysqlconn.execute(-1, new Responder(someFunction));
Just be careful that no more SQL statements execute if you expected a responder to pick up the update or error or you can encounter a runtime error.
Copy link to clipboard
Copied
Cheers Sinious - makes sense!
Copy link to clipboard
Copied
You're welcome
Find more inspiration, events, and resources on the new Adobe Community
Explore Now