Sha256: 3d2d43d6856de0b536e7ad9b8c438940ef584d528d13d5ac9aac28b93e5df73c
Contents?: true
Size: 404 Bytes
Versions: 26
Compression:
Stored size: 404 Bytes
Contents
import { withPointer, effectScheduler } from './hook-engine.mjs'; export function useEffect(cb, depArray) { withPointer((pointer) => { const oldDeps = pointer.get(); const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i])); if (hasChanged) { effectScheduler.queue(cb); } pointer.set(depArray); }); }
Version data entries
26 entries across 26 versions & 1 rubygems