Function each

    • Run body(item) per element on first sight (storing its cleanup) and run that cleanup when the element leaves. Identity is element reference — keep stable refs across mutations, don't re-create objects every frame.

      Type Parameters

      • T

      Parameters

      • source: Read<readonly T[]>
      • body: (item: T) => () => void

      Returns Lifecycle