typeorm-transactional-async-callbacks
Version:
A Transactional Method Decorator for typeorm that uses cls-hooked to handle and propagate transactions between different repositories and service methods. Inpired by Spring Trasnactional Annotation and Sequelize CLS
10 lines (9 loc) • 341 B
TypeScript
export declare type StorageKey = string;
export declare type StorageValue = unknown;
export declare type Storage = Map<StorageKey, StorageValue>;
export interface StorageDriver {
active: boolean;
get(key: StorageKey): StorageValue;
set(key: StorageKey, value: StorageValue): void;
run<T>(cb: () => Promise<T>): Promise<T>;
}