patronum icon indicating copy to clipboard operation
patronum copied to clipboard

Clock-less `delay`

Open Kelin2025 opened this issue 2 years ago • 3 comments

Add delay variation without clock
Should return a unit that triggers target after timeout

sample({
  clock: buttonPressed,
  source: $element,
  target: [scrollIntoViewFx, delay({ timeout: 100, target: pulseFx })]
})

Kelin2025 avatar May 31 '23 18:05 Kelin2025

Same for debounce & throttle

Kelin2025 avatar May 31 '23 18:05 Kelin2025

What's the case?

sergeysova avatar Jun 01 '23 17:06 sergeysova

See code snippet above - it's more convenient to describe several actions with different delays (such as animations) as a single sample+multiple targets, rather than writing several separate operators

Kelin2025 avatar Jun 01 '23 17:06 Kelin2025