alinea
Version:
Headless git-based CMS
11 lines (10 loc) • 325 B
TypeScript
export interface Emitter<T> extends AsyncIterable<T> {
emit(value: T): void;
throw(error: any): void;
return(): void;
}
export interface EmitterOptions {
onReturn?: () => void;
onThrow?: (error: any) => void;
}
export declare function createEmitter<T>({ onReturn, onThrow }?: EmitterOptions): Emitter<T>;