Function createMutex

  • Creates a mutual exclude function with the following property:

    const mutex = createMutex()
    mutex(() => {
    // This function is immediately executed
    mutex(() => {
    // This function is not executed, as the mutex is already active.
    })
    })

    Returns ((f: (() => void)) => void)

      • (f: (() => void)): void
      • Parameters

        • f: (() => void)
            • (): void
            • Returns void

        Returns void

Generated using TypeDoc