EventuallyQueue

Parse. EventuallyQueue

new EventuallyQueue()

Provides utility functions to queue objects that will be saved to the server at a later date.

Methods

(static) clear() → {Promise}

Removes all objects from queue.

Returns:
Type:
Promise

A promise that is fulfilled when queue is cleared.

(static) destroy(object, serverOptionsopt) → {Promise}

Add object to queue with save operation.

See:
Parameters:
Name Type Attributes Description
object ParseObject

Parse.Object to be destroyed eventually

serverOptions object <optional>

See Parse.Object.destroy options

Returns:
Type:
Promise

A promise that is fulfilled if object is added to queue.

(static) getQueue() → {Promise.<Array>}

Sets the in-memory queue from local storage and returns.

Returns:
Type:
Promise.<Array>

(static) isPolling() → {boolean}

Return true if pinging the server.

Returns:
Type:
boolean

(static) length() → {number}

Return the number of objects in the queue.

Returns:
Type:
number

(static) poll(msopt)

Start polling server for network connection. Will send queue if connection is established.

Parameters:
Name Type Attributes Description
ms <optional>

Milliseconds to ping the server. Default 2000ms

(static) save(object, serverOptionsopt) → {Promise}

Add object to queue with save operation.

See:
Parameters:
Name Type Attributes Description
object ParseObject

Parse.Object to be saved eventually

serverOptions object <optional>

See Parse.Object.save options.

Returns:
Type:
Promise

A promise that is fulfilled if object is added to queue.

(static) sendQueue() → {Promise.<boolean>}

Sends the queue to the server.

Returns:
Type:
Promise.<boolean>

Returns true if queue was sent successfully.

(static) stopPoll()

Turns off polling.