Http Kernel!

This commit is contained in:
garrettmills
2020-07-22 09:38:17 -05:00
parent 60bb9afa29
commit b9f2f844f3
25 changed files with 402 additions and 43 deletions

View File

@@ -0,0 +1,22 @@
import Instantiable from '../../../di/src/type/Instantiable.ts'
import {DependencyKey} from '../../../di/src/type/DependencyKey.ts'
import {make} from '../../../di/src/global.ts'
import Application from '../lifecycle/Application.ts'
export default class AppClass {
protected static make<T>(target: Instantiable<T>|DependencyKey, ...parameters: any[]) {
return make(target, ...parameters)
}
protected static get app() {
return make(Application)
}
protected make<T>(target: Instantiable<T>|DependencyKey, ...parameters: any[]) {
return make(target, ...parameters)
}
protected get app() {
return make(Application)
}
}

View File

@@ -3,12 +3,13 @@ import { Collection } from '../collection/Collection.ts'
import {container, make} from '../../../di/src/global.ts'
import {DependencyKey} from '../../../di/src/type/DependencyKey.ts'
import Instantiable, {isInstantiable} from '../../../di/src/type/Instantiable.ts'
import AppClass from './AppClass.ts'
const isLifecycleUnit = (something: any): something is (typeof LifecycleUnit) => {
return isInstantiable(something) && something.prototype instanceof LifecycleUnit
}
export default abstract class LifecycleUnit {
export default abstract class LifecycleUnit extends AppClass {
private _status = Status.Stopped
public get status() {
@@ -34,8 +35,4 @@ export default abstract class LifecycleUnit {
}
return new Collection<typeof LifecycleUnit>()
}
protected make<T>(target: Instantiable<T>|DependencyKey, ...parameters: any[]) {
return make(target, ...parameters)
}
}