<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>With subscriptions these kinds of helpers are really not needed
anymore.</p>
<p>Just do:</p>
<p> Subscription combined = Subscription.combine(<br>
property1.subscribe( ... ), <br>
property2.subscribe( ... )<br>
);</p>
<p>And clean it up with `combined.unsubscribe` in `dispose`.<br>
</p>
<p>For non-property clean-ups, you can add additional cleanup like
this:</p>
<p> Subscription combined = subscription.and(() -> { extra
clean-up code });</p>
<p>Alternatively, you can use `when(skinActive)` on most of your
observers, and set `skinActive` to `false` in dispose.</p>
<p>SkinBase was a mistake IMHO. Helper methods that require state
are better placed in an instanced utility, not in a base class.
What does it mean that a "TableViewSkin" is-a "SkinBase". Using
inheritance to get access to such helpers (which need a little bit
of state) is really a classic mistake and misuse of inheritance.
ListenerHelper is much better in that regard, much more generally
usable (since it uses composition), and stores its state in its
own instance.<br>
</p>
<p>--John<br>
</p>
<div class="moz-cite-prefix">On 12/03/2024 00:19, Marius Hanl wrote:<br>
</div>
<blockquote type="cite"
cite="mid:trinity-65f49125-d8aa-4309-8420-51375ba8357d-1710199198303@3c-app-webde-bap37">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div style="font-family: Verdana;font-size: 12.0px;">
<div>Since I see multiple discussions about the behaviour API
and the RichTextControl, I want to ask another, still
important question:</div>
<div>What is about the Skin cleanup ListenerHelper?</div>
<div> </div>
<div>We now have 2 implementations of such utility - the
<div>
<pre>LambdaMultiplePropertyChangeListenerHandler</pre>
<div>and the </div>
<div>
<pre>ListenerHelper</pre>
<div> </div>
<div>I would really see that this topic is closed and
cleaned up, with all TODOs that emerged from this than
2-3 new other open implemention changes on different
topics.</div>
<div>The class is also not public, so extending from
something else than SkinBase makes it hard to write your
own skin as there is no proper help to register and
dispose your listener.</div>
<div> </div>
<div>-- Marius</div>
</div>
</div>
</div>
</div>
</blockquote>
</body>
</html>