<html>
 <head>
  <meta name="viewport" content="width=device-width">
  <meta http-equiv="Content-Type" content="text/vnd.ui.insecure+html;charset=utf-8">
 </head>
 <body style="overflow-wrap:break-word; word-break: break-word;"><div class="mail_android_message" style="line-height: 1; padding: 0.5em">Thanks for providing the examples with the Subscription API.<br/><br/>Note though that I rather want to talk about that we have 2 different components taking care of the listeners and both are mixed up. ListenerHelper is totally fine for me, but that should be the only one.<br/><br/>It would be nice to complete the chapter of leaking skins completely before tackling the next big changes. My opinion though.<br/><br/>-- Marius</div><div class="mail_android_quote" style="line-height: 1; padding: 0.3em"><html><body>Am 12.03.24, 09:40 schrieb John Hendrikx <john.hendrikx@gmail.com>:</body></html><blockquote class="gmail_quote" style="margin: 0.8ex 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

  <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>
   <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>
 </blockquote></div></body>
</html>