Constructor
new RangeBinding(anchor, createInstance, blocks, locals, onBlockMountedopt)
Parameters:
Members
onBlockMounted :function
Called after a block's nodes enter the document.
A block can contain a child-component mount point, and the pass that
instantiates those scans the subtree -- so it has to be told that the
subtree grew. Without this a component inside <@for>, <@if> or
<@defer> renders its placeholder and never mounts, which is exactly
the defect the E2E suite pinned for <@defer>.
Type:
- function
parent
The node new content is inserted into.
Methods
createRange(index, extra) → {BlockRange|null}
Builds a range for one block index.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
index |
number | The block index. |
|
extra |
object | null | null | Local bindings this block adds. |
Returns:
The range, or null when the index is absent.
- Type
- BlockRange | null
mountRange(range, parent, after) → {Node}
Mounts a range and announces it.
Parameters:
| Name | Type | Description |
|---|---|---|
range |
BlockRange | The range to mount. |
parent |
Node | The parent node. |
after |
Node | The node to insert after. |
Returns:
The last node inserted.
- Type
- Node