Skip to content

Function: createLatestQueue() ​

ts
function createLatestQueue<Req, Res>(run, deliver): LatestQueue<Req>;

Experimental

Create a LatestQueue: run performs one request; deliver receives each result that is still current. A rejected run delivers nothing for that request but keeps the queue going.

Type Parameters ​

Type Parameter
Req
Res

Parameters ​

ParameterType
run(request) => Promise<Res>
deliver(result, request) => void

Returns ​

LatestQueue<Req>

Released under the MIT License.