kylergib / WaveLinkPluginTouchPortal

GNU General Public License v3.0
5 stars 1 forks source link

You might want to use a callback for this kind of things? #3

Closed ChristopheCVB closed 1 year ago

ChristopheCVB commented 1 year ago

https://github.com/kylergib/WaveLinkPluginTouchPortal/blob/d552ca6c575a09998516a46055e2c3d10a41e3dd/src/main/java/com/kylergib/wavelinktp/WaveLinkPlugin.java#L120

kylergib commented 1 year ago

created callback in PR https://github.com/kylergib/WaveLinkPluginTouchPortal/pull/6

honestly have never used call backs so i did a few hours of research on callbacks and i still am unsure how exactly to use them. I did create a call back interface and created an onConfigsReceived callback and it seems to work, but if possible would like your input on if i implemented it correctly or not.

I pasted the permalinks to the code changes for the callback if you could have a look i would greatly appreciate it.

https://github.com/kylergib/WaveLinkPluginTouchPortal/blob/88e46db7808d173ee98b43ccfeae1084aed75237/src/main/java/com/kylergib/wavelinktp/WaveLinkPlugin.java#LL640C5-L647C6

https://github.com/kylergib/WaveLinkPluginTouchPortal/blob/88e46db7808d173ee98b43ccfeae1084aed75237/src/main/java/com/kylergib/wavelinktp/model/WaveLinkClient.java#LL73C13-L76C14

https://github.com/kylergib/WaveLinkPluginTouchPortal/blob/development/src/main/java/com/kylergib/wavelinktp/model/WaveLinkCallback.java#L1