-
Buckley authored
Embedded components allow users to leverage existing provider modules in order to customize specific pieces of the dependency tree. This is useful for keeping code DRY by not requiring providers to be copied whenever a new module is needed for different purposes. In order to embed a component, simply create a provider for an already generated component, then add a `// @component` comment above the provider much like one might do to specify that a provider should be a singleton. di assumes that you have access to the source for the embedded provider as it must inspect that source in order to function properly. An error will be returned if the source is not available or if it is not able to be parsed.
Buckley authoredEmbedded components allow users to leverage existing provider modules in order to customize specific pieces of the dependency tree. This is useful for keeping code DRY by not requiring providers to be copied whenever a new module is needed for different purposes. In order to embed a component, simply create a provider for an already generated component, then add a `// @component` comment above the provider much like one might do to specify that a provider should be a singleton. di assumes that you have access to the source for the embedded provider as it must inspect that source in order to function properly. An error will be returned if the source is not available or if it is not able to be parsed.
This project is licensed under the MIT License.
Learn more
Loading