Class: QueryBlock

QueryBlock

A QueryBlock corresponds to the object that follows the execution of a listDef for one of it's block. A block will wait to be ready (when the last instance is reached) to execute its last callback and notify its parent to potentially propagate the execution of the query if all children blocks are ready.


new QueryBlock(id [, parent])

Parameters:
Name Type Argument Default Description
id string
parent QueryBlock <optional>
null

Members


<nullable> last :string

Type:
  • string

<nullable> lastCallback :function

Type:
  • function

<nullable> parent :QueryBlock

Type:

<nullable> waitingCallback :function

Type:
  • function

Methods


activate(index)

Run the last callback if the specified instance's index is marked as the last of this block.

Parameters:
Name Type Argument Description
index string <nullable>

addChild(id)

Add a child to this block

Parameters:
Name Type Description
id string

getId()

Returns the block id

Returns:
Type
string

notify(id)

Set the specified to ready and execute the waiting callback if all children are ready

Parameters:
Name Type Description
id string

setReady()

Set this block state to ready and notifies the parent about its new state.