Class: IfBinding

lib/core/renderer/program/blocks.IfBinding(anchor, createInstance, blocks, locals, onBlockMountedopt)

Renders the first arm whose test is truthy.

Constructor

new IfBinding(anchor, createInstance, blocks, locals, onBlockMountedopt)

Parameters:
Name Type Attributes Description
anchor Text

The op's anchor.

createInstance function

Builds a template instance for a block.

blocks Array:.<object:>

The program's block table.

locals object | null

The enclosing block's local bindings.

onBlockMounted function <optional>

Announces a mounted block.

Source:

Members

activeArm :number

Type:
  • number
Source:

range :BlockRange|null

Type:
  • BlockRange | null
Source:

Methods

dispose()

Releases the rendered arm.

Source:

update(arms, evaluate)

Selects and renders the matching arm.

Parameters:
Name Type Description
arms Array:.<{x:: (number:|null:), b:: number:}>

The op's arms, in order.

evaluate function

Evaluates an expression index.

Source: