Function
getCurrent
(ref: StateRef, forkPage?: Scope)
Source from the content-addressed store, hash-verified
| 331 | } |
| 332 | |
| 333 | function getCurrent(ref: StateRef, forkPage?: Scope) { |
| 334 | let result |
| 335 | if (forkPage) result = forkPage.getState(ref) |
| 336 | else result = ref.current |
| 337 | switch (ref.type) { |
| 338 | case 'list': |
| 339 | return [...result] |
| 340 | case 'shape': |
| 341 | return {...result} |
| 342 | default: |
| 343 | return result |
| 344 | } |
| 345 | } |
| 346 | function findRef( |
| 347 | ref: StateRef, |
| 348 | targetLeaf: Leaf | null, |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…