Class: BuildGenerationTracker

BuildGenerationTracker()

Tracks the most recently started "generation" (build/run) so a caller can tell whether a given generation is still the current one. Framework/DOM-independent by design so it can be unit tested in isolation.

Constructor

new BuildGenerationTracker()

Create a new tracker with no generation started yet.
Source:

Methods

isCurrent(generationId) → {boolean}

Check whether a generation ID is still the most recently started one.
Parameters:
Name Type Description
generationId number The generation ID to check.
Source:
Returns:
True if generationId is still the latest generation.
Type
boolean

startNewGeneration() → {number}

Start a new generation, superseding any previously started generation.
Source:
Returns:
The new generation's ID.
Type
number