codeMutex.d.ts 268 B

123456
  1. import type { Code } from './types';
  2. /**
  3. * Executes only one instance of give code at a time. If other calls come in in
  4. * parallel, they get resolved to the result of the ongoing execution.
  5. */
  6. export declare const codeMutex: <T>() => (code: Code<T>) => Promise<T>;