UNPKG

@minimaltech/ra-infra

Version:

Minimal Technology ReactJS Infrastructure

35 lines 1.54 kB
import { Context, } from '@loopback/context'; // -------------------------------------------------------------------------------- export class AbstractRaApplication extends Context { // ------------------------------------------------------------------------------ // Context Binding // ------------------------------------------------------------------------------ preConfigure() { this.bindContext(); } // ------------------------------------------------------------------------------ postConfigure() { } // ------------------------------------------------------------------------------ injectable(scope, value, tags) { this.bind(`${scope}.${value.name}`) .toInjectable(value) .tag(...(tags ?? []), scope); } // ------------------------------------------------------------------------------ /* provider<T>(value: DynamicValueProviderClass<T> | Constructor<T>) { this.injectable('providers', value); } */ // ------------------------------------------------------------------------------ service(value) { this.injectable('services', value); } // ------------------------------------------------------------------------------ async start() { await this.preConfigure(); await this.postConfigure(); } } // -------------------------------------------------------------------------------- export class BaseRaApplication extends AbstractRaApplication { } //# sourceMappingURL=base.application.js.map