Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Commit a290582

Browse files
feat(core): add types
1 parent ad8a376 commit a290582

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/provide-once.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { Optional, SkipSelf } from '@angular/core';
1+
import { Optional, Provider, SkipSelf, Type } from '@angular/core';
22
import { reflector } from '@angular/core/src/reflection/reflection';
33
import { ReflectionCapabilities } from '@angular/core/src/reflection/reflection_capabilities';
44

5-
export function ProvideOnce(input) {
5+
export function ProvideOnce<T>(input: Type<T>): Provider {
66
return {
77
provide: input,
88
deps: [[new Optional(), new SkipSelf(), input], ...reflector.parameters(input)],
9-
useFactory: (parent, ...args) => parent || reflector.factory(input).apply(this, [...args])
9+
useFactory: (parent: Type<T>, ...args) => parent || reflector.factory(input).apply(this, [...args])
1010
};
1111
}

0 commit comments

Comments
 (0)