Module

Promise

Methods

# static queueOperationOnce(uniqueId, handler, millisecondsOrOptions)

Queue function to be called after certain time (like setTimeout) but skips if already queued.

Useful for delaying operations in vue watchers/computed properties (To avoid multiple simultaneous calls and performance issues)

This code is an async function called queueOperationOnce with 3 parameters (uniqueId, handler and millisecondsOrOptions). The function checkes if the parameters are valid and then starts a timeout that calls the specified handler. This code is used to ensure that only one instance of an operation runs at any given time - when another instance of the same operation is triggered, the new instance will be skipped and cleared or replaced, depending on the specified option.

Parameters:
Name Type Description
uniqueId String

The unique identifier for the queue

handler function

handler to be queued and executed after certain time.

millisecondsOrOptions Number

Timeout in milliseconds

timeout Number

Timeout in milliseconds

isSequential Boolean

Skip if similar operation is processing

clearPreviousTimeout Boolean

If true, previous queued operations will be overrided

View Source utils/promise.js, line 56

# static splitOperation()

Generic helper for progresive searchs.

Used to split heavy requests without pagination support (Geored APIV2).

Parameters:
Name Type Description
options.generateSubsets function

Handler to generate subsets

options.handleSubsets function

Handler to process and resolve subsets

options.withSubsetResult function

Handler to control a subset result

options.sequential Boolean

Subsets will resolve sequentially

View Source utils/promise.js, line 16