MCPcopy Create free account
hub / github.com/effector/effector / node

Function node

src/forest/method/node.ts:7–23  ·  view source on GitHub ↗
(cb: (node: DOMElement) => (() => void) | void)

Source from the content-addressed store, hash-verified

5import {assertClosure} from '../assert'
6
7export function node(cb: (node: DOMElement) => (() => void) | void) {
8 assertClosure(currentTemplate, 'node')
9 const draft = currentTemplate.draft
10 switch (draft.type) {
11 case 'list':
12 case 'listItem':
13 case 'using':
14 case 'route':
15 case 'rec':
16 case 'recItem':
17 case 'block':
18 case 'blockItem':
19 console.error('node() hook supported only in h() nodes')
20 return
21 }
22 draft.node.push(cb)
23}

Callers 2

index.test.tsFile · 0.90
fnFunction · 0.90

Calls 1

assertClosureFunction · 0.90

Tested by 1

fnFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…