meshtastic / js

JS/TS library for interfacing with Meshtastic devices
https://meshtastic.org
GNU General Public License v3.0
74 stars 36 forks source link

Switch to RxJS #27

Closed sachaw closed 3 years ago

sachaw commented 3 years ago

This will retire sub-events in favor of RxJS Here's a good article showing the power of RxJS: https://blog.mimacom.com/eight-reasons-why-you-should-be-using-rxjs/ As for client side changes, it's almost nothing as you still call a subscribe method on any event you want to listen to.

vitaly-t commented 3 years ago

Just curious, did you get anything good from this switch?

I mean, was there something missing in sub-events that you needed?

sachaw commented 3 years ago

@vitaly-t Originally I was having some issues with type inferrence, Can't remember exactly, and with the current structure of the library, wouldn't be an issue. I have seen some benefits client side in regards to the more powerful event consumption options and the whole stream pipeline. I may re-evaluate and go back to sub-events, as it has a far lighter footprint than RxJS.

sachaw commented 3 years ago

Just another note, I'm in the process of modernizing this library to support things like snowpack, esbuild etc and the lighter footprint of sub-events is more appealing than ever.

vitaly-t commented 3 years ago

Thank you for getting back to me on this. As the author of sub-events, I was just curious what improvements, if any should I look into. And if you manage to recall what issues with type inference you had, please let me know, as I'm not aware of any such issues.