MCPcopy Create free account
hub / github.com/Effect-TS/effect / commitLater

Function commitLater

packages/ui/native/src/kit/Animation.ts:1097–1109  ·  view source on GitHub ↗
(st: Sticky, host: Native.ViewHost)

Source from the content-addressed store, hash-verified

1095// for hit tests, once the scroll pauses, as React Native's
1096// `ScrollViewStickyHeader` does on Fabric.
1097const commitLater = (st: Sticky, host: Native.ViewHost) => {
1098 clearTimeout(st.timer)
1099 st.timer = setTimeout(() => {
1100 st.timer = undefined
1101 for (const h of st.headers) {
1102 const { value } = headers.get(h)!
1103 if (value !== undefined && mounted(h)) {
1104 host.set(h, "transform", [{ translateY: value }])
1105 }
1106 }
1107 host.commit()
1108 }, host.os === "android" ? 15 : 64)
1109}
1110
1111const sourceOf = (d: Driver, name: string): Source => {
1112 let s = d.sources.get(name)

Callers 1

listenFunction · 0.85

Calls 4

mountedFunction · 0.90
getMethod · 0.65
setMethod · 0.65
commitMethod · 0.45

Tested by

no test coverage detected