UNPKG

upload-js

Version:

File Upload Library — Upload.js gives developers AJAX multipart file uploading via XHR 🚀 Comes with Cloud Storage 🌐

12 lines (11 loc) 500 B
import { MutexInterface } from "./MutexInterface"; /** * A lightweight mutex. (Other libraries contain too many features and we want to keep the size upload-js down). * * Characteristics: * - Non-reentrant. * - Unfair. (Multiple callers awaiting 'acquire' will be granted the mutex in no order.) * - When calling `safe` consecutively with no 'awaits' in-between, the current context will synchronously acquire * the mutex every time. */ export declare function Mutex(): MutexInterface;