Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / angular/src/public-api / SxConditionalBlock

Class: SxConditionalBlock ​

Defined in: projects/libraries/streamix/angular/src/lib/structural-block.ts:209

Renders the first branch whose condition is truthy as direct DOM.

There is no Angular view and no change detection involved: a source emission schedules one frame, the winning branch is re-selected, and the rendered branch is swapped in place.

Constructors ​

Constructor ​

new SxConditionalBlock(anchor, branches): SxConditionalBlock

Defined in: projects/libraries/streamix/angular/src/lib/structural-block.ts:217

Parameters ​

anchor ​

Node

branches ​

readonly SxConditionalBranch[]

Returns ​

SxConditionalBlock

Methods ​

bind() ​

bind(): void

Defined in: projects/libraries/streamix/angular/src/lib/structural-block.ts:222

Returns ​

void


destroy() ​

destroy(): void

Defined in: projects/libraries/streamix/angular/src/lib/structural-block.ts:250

Returns ​

void


refresh() ​

refresh(): void

Defined in: projects/libraries/streamix/angular/src/lib/structural-block.ts:265

Re-evaluates the branch selection synchronously. Used by a nested block whose condition reads the enclosing loop context, which changes without any source emission.

Returns ​

void

Released under the MIT License.