All files / src/projection use-instant-layout-transition.ts

87.5% Statements 7/8
66.67% Branches 4/6
100% Functions 2/2
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 1530x   30x     18x       2x 2x 2x 2x    
import { rootProjectionNode } from "./node/HTMLProjectionNode"
 
export function useInstantLayoutTransition(): (
    cb?: (() => void) | undefined
) => void {
    return startTransition
}
 
function startTransition(cb?: () => void) {
    Iif (!rootProjectionNode.current) return
    rootProjectionNode.current.isUpdating = false
    rootProjectionNode.current.blockUpdate()
    cb?.()
}