Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Madjarx opened this issue Mar 21, 2023 · 2 comments
Open
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@Madjarx
Copy link
Member

Madjarx commented Mar 21, 2023

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
Copy link
Member Author

Madjarx commented Mar 21, 2023

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

@Madjarx
Copy link
Member Author

Madjarx commented Mar 21, 2023

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

@Madjarx Madjarx self-assigned this Mar 21, 2023
@Madjarx Madjarx added enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Mar 21, 2023
@Madjarx Madjarx changed the title Function Aliases in Push Protocol implementation (__Code Readability__): Function Aliases in Push Protocol implementation Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant