Skip to content

Allow direct scalar value as service parameters #4

Description

@Tom32i

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']);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions