Home

starfederation/datastar

Status:Indexed
Analyzed 3d ago3K+ starsTypeScript

The hypermedia framework.

Back to Pull Requests
#1091Closed
Simple Review

Emit the last event from a throttle interval when using 'trailing'

by gazpachokingNov 6, 2025
View on GitHub

Summary

This PR fixes an issue with the throttle event modifier in Datastar. Previously, when using the 'trailing' option, the throttled event would fire with the first event within the throttle window instead of the last. This change ensures the last event is correctly emitted, and also prevents duplicate event emissions when both leading and trailing edges are enabled for throttle/debounce.

Changes

+19 additions-36 deletions

Impact Areas

Event HandlingPerformance