reflex-dom icon indicating copy to clipboard operation
reflex-dom copied to clipboard

Disconnect event handlers?

Open albertov opened this issue 8 years ago • 0 comments

Hi,

After migrating to the develop branch I can't find a way to use the "disconnect" functionality previously provided by newEventWithTrigger.

The thing is that I need to trigger the event from a callback which is passed to a foreign library from IO. I could do this before like this and reflex would take my cleanup function to run it when the event is GCd. This is very important for my use-case as I need to release the haskell callback in order not to leak memory when an olMap widget is destroyed.

However, with the new API the best I could come up with is this . If I use newEventWithTrigger the only way I can find to trigger the event is with fireEvents but I cannot run that from IO. The only way I could find to get an "IO-triggerable" trigger is with newTriggerEvent but I see no way to release it when I'm done with it.

What would be the correct way to do this with the new API?

Thanks!

albertov avatar Oct 31 '16 10:10 albertov