Skip to content

Throttle with custom edges options works just like a debounce. #1212

@FourwingsY

Description

@FourwingsY
const throttledOnScroll = throttle(onScroll, 100, { edges: ["trailing"] })

This code expects to work like a "Throttle" function,
Which invokes onScroll function every 100ms while I keep scrolling,
AND Just last trailing call even if scroll ends within delayed 100ms.

but that code just works like debounce. kept scrolling 10s, but just a single call at the last moment.

Is this intended?
I couldn't find expected behaviors on function/throttle.spec.ts with these options set.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions