@triviality/core
Version:
Purely typed service container
13 lines (12 loc) • 432 B
TypeScript
/**
* Context helper for using async services.
*/
import { SF } from '../ServiceFactory';
import { InternalContextContext } from './InternalContextContext';
export interface AsyncContext {
/**
* Convert async service factory to sync service factory.
*/
synchronize<T>(sf: () => Promise<T>): SF<T>;
}
export declare const createFeatureFactoryAsyncContext: ({ container }: InternalContextContext) => AsyncContext;