Skip to content

Allow defining optional inject dependency with default values #6097

Closed
@pdanpdan

Description

@pdanpdan

What problem does this feature solve?

In case of components that can work both as standalone and as children, it would be nice to be able to provide default values for the not provided dependencies.
It would also avoid the warning for missing inject in case this is one of the expected use case.

What does the proposed API look like?

inject: Array | { [key: string]: string | Symbol | { name: string | Symbol, default: any } }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions