Class: DataCacheOperation

DataCacheOperation

new DataCacheOperation(stateMachine, promise, isCancelable, index, count, data, pending) → {DataCacheOperation}

Creates a new operation object.
Parameters:
Name Type Description
stateMachine function State machine that describes the specific behavior of the operation.
promise DjsDeferred Promise for requested values.
isCancelable Boolean Whether this operation can be canceled or not.
index Number Index of first item requested.
count Number Count of items requested.
data Array Array with the items requested by the operation.
pending Number Total number of pending prefetch records.
Source:
Returns:
A new data cache operation instance.
Type
DataCacheOperation

Methods

cancel()

Transitions this operation to the cancel state and sets the canceled flag to true. The function is a no-op if the operation is non-cancelable.
Source:

complete()

Transitions this operation to the end state.
Source:

error()

Transitions this operation to the error state.
Source:

fireCanceled()

Fires a canceled notification as necessary.
Source:

fireRejected()

Fires a rejected notification as necessary.
Source:

fireResolved()

Fires a resolved notification as necessary.
Source:

operationStateMachine(opTargetState, cacheState, data)

State machine that describes all operations common behavior.
Parameters:
Name Type Argument Description
opTargetState Object Operation state to transition to.
cacheState Object Current cache state.
data Object <optional>
Additional data passed to the state.
Source:

run(state)

Executes the operation's current state in the context of a new cache state.
Parameters:
Name Type Description
state Object New cache state.
Source:

transition(state, data)

Transitions this operation to a new state.
Parameters:
Name Type Argument Description
state Object State to transition the operation to.
data Object <optional>
-
Source:

wait()

Transitions this operation to the wait state.
Source: