You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
648 B
25 lines
648 B
4 years ago
|
import Factory from './Factory.ts'
|
||
|
import {Collection} from '../../../lib/src/collection/Collection.ts'
|
||
|
import {DependencyRequirement} from '../type/DependencyRequirement.ts'
|
||
|
|
||
|
export default class SingletonFactory extends Factory {
|
||
|
constructor(
|
||
|
protected token: FunctionConstructor,
|
||
|
protected key: string,
|
||
|
) {
|
||
|
super(token)
|
||
|
}
|
||
|
|
||
|
produce(dependencies: any[], parameters: any[]) {
|
||
|
return this.token
|
||
|
}
|
||
|
|
||
|
match(something: any) {
|
||
|
return something === this.key
|
||
|
}
|
||
|
|
||
|
get_dependency_keys(): Collection<DependencyRequirement> {
|
||
|
return new Collection<DependencyRequirement>()
|
||
|
}
|
||
|
}
|