SodiumFRP / sodium

Sodium - Functional Reactive Programming (FRP) Library for multiple languages
http://sodium.nz/
Other
848 stars 138 forks source link

Feature Request: listenWeak for Cell in Java version. #117

Closed clinuxrulz closed 6 years ago

clinuxrulz commented 6 years ago

I'm aware of the removeNotify() trick used in SWidgets.

However when a gui component is removed from its parent, it does not always mean that it is no longer used. Some gui components can switch to a different parent, still triggering the removeNotify() midway.

So the end-user can have their own keepAlive list in their UI class, and use weak listeners instead to work around the problem. Just would be handy to have a listenWeak on Cell to cut down on key-strokes.

the-real-blackh commented 6 years ago

That sounds reasonable. I'll implement it some time. Feel free to do it yourself.