@loopback/context
Version:
Facilities to manage artifacts and their dependencies in your Node.js applications. The module exposes TypeScript/JavaScript APIs and decorators to register artifacts, declare dependencies, and resolve artifacts by keys. It also serves as an IoC container
24 lines (23 loc) • 503 B
TypeScript
import { Binding } from './binding';
import { Context } from './context';
/**
* Events emitted by a context
*/
export type ContextEvent = {
/**
* Source context that emits the event
*/
context: Context;
/**
* Binding that is being added/removed/updated
*/
binding: Readonly<Binding<unknown>>;
/**
* Event type
*/
type: string;
};
/**
* Synchronous listener for context events
*/
export type ContextEventListener = (event: ContextEvent) => void;