OfflineManager
@blobs/sdk / plugins / OfflineManager
Defined in: plugins/OfflinePlugin.ts:70
Constructors
Constructor
new OfflineManager(
sdk,config?):OfflineManager
Defined in: plugins/OfflinePlugin.ts:76
Parameters
sdk
any
config?
OfflinePluginConfig = {}
Returns
OfflineManager
Methods
processQueue()
processQueue():
Promise<void>
Defined in: plugins/OfflinePlugin.ts:108
Drains the queue while connectivity holds. Failures are retried
by re-queuing at the tail until the per-action budget is
exhausted, at which point onActionFailed is invoked.
Returns
Promise<void>
queueAction()
queueAction(
action):string
Defined in: plugins/OfflinePlugin.ts:147
Appends an action to the queue. Drops the oldest entry first when the queue is at capacity.
Parameters
action
Omit<QueuedAction, "id" | "timestamp">
Action to enqueue (id and timestamp are filled in).
Returns
string
The id assigned to the new entry.
removeAction()
removeAction(
id):void
Defined in: plugins/OfflinePlugin.ts:173
Removes the queued action with the given id, if any.
Parameters
id
string
Queue id returned by queueAction.
Returns
void
getQueue()
getQueue():
QueuedAction[]
Defined in: plugins/OfflinePlugin.ts:184
Returns a defensive copy of the current queue contents.
Returns
getQueueSize()
getQueueSize():
number
Defined in: plugins/OfflinePlugin.ts:191
Returns the number of actions currently queued.
Returns
number
isNetworkOnline()
isNetworkOnline():
boolean
Defined in: plugins/OfflinePlugin.ts:199
Returns the cached online flag (driven by navigator.onLine and
the online/offline window events).
Returns
boolean