getSource()function
getSource(type: Class<T>, value: unknown): T | undefined
| Param | Type | |
|---|---|---|
type | Class<T> | The class to search for an instance of. required |
value | unknown | The object to start searching from. required |
| Return | |
|---|---|
T | undefined | The first matching source instance, or undefined if none matches. |
Recurse through Sourceable objects and return the first one that is an instance of type, or undefined if no source object matches.
- Follows the
sourceproperty chain (e.g. layered providers) until a matching instance is found.
Examples
getSource(CacheProvider, provider) // CacheProvider instance or undefined