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
670 B

import AbstractFactory from './AbstractFactory.ts'
import {DependencyRequirement} from '../type/DependencyRequirement.ts'
import {Collection} from '../../../lib/src/collection/Collection.ts'
export default class FunctionFactory extends AbstractFactory {
constructor(
protected name: string,
protected token: () => any,
) {
super(token)
}
get_dependency_keys(): Collection<DependencyRequirement> {
return new Collection<DependencyRequirement>()
}
match(something: any) {
return something === this.name
}
produce(dependencies: any[], parameters: any[]): any {
return this.token()
}
}