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

Feature Request: Reusing services for mutliple redux variables #53

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

testless
Copy link

@testless testless commented Aug 21, 2018

Summary

  • Tell us about the problem your pull request is solving.

At the moment, is it only possible to use a service once.

But there might be situations, where you want the same services being stored in different variables.
At the moment, the code assume serviceName => variableName, thus providing a way of renaming the serviceName only.
My proposal here is to variableName => serviceName, which would allow something like.

myUser -> users
currentlySelectedUser -> users
myBoss -> users

  • Are there any open issues that are related to this?

No

  • Is this PR dependent on PRs in other repos?

No

At the moment, is it only possible to use a service once.

But there might be situations, where you want the same services being stored in different variables.
At the moment, the code assume serviceName => variableName, thus providing a way of  renaming the serviceName only.
My proposal here is to variableName => serviceName, which would allow something like.

myUser -> users
currentlySelectedUser -> users
myBoss -> users
@testless
Copy link
Author

However, this will be a breaking change.

@testless
Copy link
Author

Ok, I thought about it a little bit and found a better non-breaking proposition.

User of your library could now use
{ '/users/:slug': ['myUser', 'currentlySelectedUser', 'myBoss'] }

@eddyystop
Copy link
Collaborator

I will have to think on this.

I understand the issue and would prefer a more baked-in solution.

@frinzekt
Copy link

What's the verdict on this, because it seems a good solution?

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.

3 participants