multex.js
Multi-access mutexes (a.k.a locks, semaphores) with access control strategies (last-only, first-only).
Multexes
LastOnly
FirstOnly
Examples
Asynchronous callback cancellation
Use a last-only multex to effectively cancel or abort all but the latest callback in any series of asynchronous calls. This is like debouncing, but better, as it should guarantee only one execution immediately after the last async call returns.
var multex = ; 012;