node-eth / node-eth-packages

Monorepo containing all the packages developed / in development by the NodeETH team. Repo will get you set up to start developing with the use of hardhat and nodeRED
https://docs.nodeeth.org
Apache License 2.0
1 stars 1 forks source link

(__Code Readability__): Function Aliases in Push Protocol implementation #6

Open Madjarx opened 1 year ago

Madjarx commented 1 year ago

Push protocol is a great tool but the thing is it has a lot of methods/functions with similar names

subscribe & unsubscribe look pretty similar when you skim over them and when you have a lot of stuff on your mind

I've come to the point where i have methods such as: unsubscribeFromChannel and subscribeToChannel and you might argue that it is a bad naming convention and i do share some opinions on that. Visually they are hard to distinguish when working.

I would say that a temporary solution would be method aliasing in the main ./lib/PushService.js with proper and quite visible documentation, such as alias of subscribeToChannel could be optIn, vice versa optOut

This could be a temporary solution until we refactor the class and break it down into smaller pieces that are user / channel / specific-field-oriented

Madjarx commented 1 year ago

Additional attachments for ref: Screenshot from 2023-03-22 00-14-31

Madjarx commented 1 year ago

This is just bothering me visually, issues like these SHOULD NOT exist in publicly released package's source code