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

Changed LocalStorage(a singleton class) init to private #248

Closed
wants to merge 1 commit into from
Closed

Changed LocalStorage(a singleton class) init to private #248

wants to merge 1 commit into from

Conversation

ShresthPratapSingh
Copy link
Contributor

A shared instance of LocalStorage class is used in the app in order to provide Global point access to its object. Since the init was still public anyone could create a new object of LocalStorage, killing the whole point of using a shared instance and this provides room for errors.
Making the init private ensures that creating new objects of this class is prohibited and you are compelled to use the shared instance.

@ShresthPratapSingh ShresthPratapSingh changed the base branch from master to beta June 26, 2020 21:53
@ShresthPratapSingh
Copy link
Contributor Author

Conflicts are resolved in another PR #297 . This PR shall be closed after merging #297

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

Successfully merging this pull request may close these issues.

2 participants