@chubbyts/chubbyts-framework
Version:
A minimal, highly performant middleware PSR-15 inspired function based micro framework built with as little complexity as possible, aimed primarily at those developers who want to understand all the vendors they use.
21 lines (20 loc) • 937 B
TypeScript
import type { Container } from '@chubbyts/chubbyts-dic-types/dist/container';
import type { Handler } from '@chubbyts/chubbyts-undici-server/dist/server';
/**
* ```ts
* import type { Container } from '@chubbyts/chubbyts-dic-types/dist/container';
* import { createContainer } from '@chubbyts/chubbyts-dic/dist/container';
* import type { Handler } from '@chubbyts/chubbyts-undici-server/dist/server';
* import type { Logger } from 'some-logger/dist/logger';
* import { createLazyHandler } from '@chubbyts/chubbyts-framework/dist/handler/lazy-handler';
*
* const container: Container = createContainer();
*
* container.set('handlerServiceId', (container: Container): Handler => {
* return createMyHandler(container.get<Logger>('logger'));
* });
*
* const handler: Handler = createLazyHandler(container, 'handlerServiceId');
* ```
*/
export declare const createLazyHandler: (container: Container, id: string) => Handler;