Skip to content
This repository has been archived by the owner on Jun 7, 2019. It is now read-only.

API should hide private methods #77

Closed
slaweet opened this issue Mar 30, 2017 · 4 comments
Closed

API should hide private methods #77

slaweet opened this issue Mar 30, 2017 · 4 comments

Comments

@slaweet
Copy link
Contributor

slaweet commented Mar 30, 2017

There are several methods in the lisk-js API that aren't mentioned in the docs, look more like internal utility functions and shouldn't really be used by public, e.g. sendRequestPromise, getRandomPeer, banNode ...

If we expose these methods, people might use them in their projects and then we have to support them else we break other people's projects. On the other hand, if we make them private we can easily refactor and change their behaviour if necessary in the future.

There are several ways to emulate private methods in JavaScrtipt:
http://stackoverflow.com/questions/55611/javascript-private-methods

@karmacoma karmacoma changed the title The API should hide private methods API should hide private methods Apr 21, 2017
@karmacoma karmacoma modified the milestone: Version 1.0.0 Apr 21, 2017
@alepop
Copy link
Contributor

alepop commented May 23, 2017

@slaweet can you type a full list of a private method?

@slaweet
Copy link
Contributor Author

slaweet commented May 23, 2017

@alepop I'm not so familiar with lisk-js code to easily give a full list. @Tosch110 might be a more suitable person to do that.

@alepop
Copy link
Contributor

alepop commented May 26, 2017

@slaweet maybe all methods that are not in this list is private?

@slaweet
Copy link
Contributor Author

slaweet commented May 29, 2017

@alepop makes sense. If not in documentation then they are private.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants