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

Allow direct scalar value as service parameters #4

Open
Tom32i opened this issue Nov 14, 2018 · 0 comments
Open

Allow direct scalar value as service parameters #4

Tom32i opened this issue Nov 14, 2018 · 0 comments
Assignees

Comments

@Tom32i
Copy link
Contributor

Tom32i commented Nov 14, 2018

Would require a way / format to specify if the argument is another service or just a string.

// An HTTP client service
class HTTPClient {}

// An API service
class API {
    /**
     * @param {HTTPClient} client
     * @param {String} hostname
     */
    constructor(client, hostname = 'localhost') {

    }
}

// It would be nice to inject scalar as parameter without having to define a parameter for it.
container.registerDefinition('client', HTTPClient);
container.registerDefinition('api', API, ['client', 'http://my.domain.com:8080']);
@Tom32i Tom32i self-assigned this Nov 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant