Skip to content

Commit

Permalink
fix: emit onSizeChange when the size is calculated the first time
Browse files Browse the repository at this point in the history
  • Loading branch information
bbohlender committed Jun 8, 2024
1 parent cea65d1 commit 2282034
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions packages/uikit/src/listeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,12 @@ export function setupLayoutListeners(
size: Signal<Vector2Tuple | undefined>,
initializers: Initializers,
) {
let first = true
initializers.push(() =>
effect(() => {
const s = size.value
if (s == null) {
return
}
if (first) {
first = false
return
}
l1.peek()?.onSizeChange?.(...s)
l2.peek()?.onSizeChange?.(...s)
}),
Expand Down

0 comments on commit 2282034

Please sign in to comment.