Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants