Class: Batch

Batch

Class storing queue of DOM operations.

new Batch()

Constructing new batch.

Methods


add(type, fn)

Add new operation to the batch.
Parameters:
Name Type Description
type String Type of operation. Must be either "read" or "write".
fn function Operation to be fired.
Returns:
Current BEMQuery instance.
Type
BEMQuery

run(type)

Run operations of given type.
Parameters:
Name Type Description
type String Type of operations to run. Must be either "read" or "write".
Returns:
Promise that will be fulfilled after running all tasks.
Type
Promise