@solid-primitives/debounce

Primitive that creates a debounce function

Usage no npm install needed!

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

README

@solid-primitives/debounce

lerna size size stage

Creates a helpful debounce function.

Installation

npm install @solid-primitives/debounce
# or
yarn add @solid-primitives/debounce

How to use it

const [fn, clear] = createDebounce(() => console.log('hi'), 250));
fn('my-new-value');

Demo

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

Changelog

Expand Changelog

1.0.0

Initial commit and publish of debounce primitive.

1.0.1

Improved types, minor clean-up and added tests.

1.0.2

Changed any to unknown type and applied patch from high1.

1.0.5

Adding CJS support to package.

1.0.8

Cleaned up documentation

1.1.0

Updated to Solid 1.3