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

inject types error #83

Closed
Mister-Hope opened this issue Aug 25, 2019 · 0 comments
Closed

inject types error #83

Mister-Hope opened this issue Aug 25, 2019 · 0 comments

Comments

@Mister-Hope
Copy link
Contributor

Declaration file in this lib:

export interface InjectionKey<T> extends Symbol {
}
export declare function provide<T>(key: InjectionKey<T> | string, value: T): void;
export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T): T;

Docs:

link

  • Typing
interface InjectionKey<T> extends Symbol {}

function provide<T>(key: InjectionKey<T> | string, value: T): void

// without default value
function inject<T>(key: InjectionKey<T> | string): T | undefined
// with default value
function inject<T>(key: InjectionKey<T> | string, defaultValue: T): T
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant