@solid-primitives/throttle

Primitive that creates a throttle function

Usage no npm install needed!

<script type="module">
  import solidPrimitivesThrottle from 'https://cdn.skypack.dev/@solid-primitives/throttle';
</script>

README

@solid-primitives/throttle

lerna size size stage

Creates a throttled function that invokes at most once per specified time.

How to use it

const [trigger, clear] = createThrottle((value) => console.log(value), 250));
trigger('my-new-value');

Demo

You may view a working example here: https://codesandbox.io/s/solid-primitives-throttle-h2wni?file=/src/index.tsx

Changelog

Expand Changelog

0.0.100

First version of the throttle primitive.

1.0.3

Cleaned up return types and documentation.

1.0.8

Adding CJS support to package.

1.1.0

Updated to Solid 1.3