Creates a throttled function that invokes at most once per specified time.
When used in an reactive context (effect or component), any throttled function pending to execute will be automatically canceled when the context is cleaned up.
const [trigger, clear] = createThrottle((value) => console.log(value), 250)); trigger('my-new-value');
You may view a working example here: https://codesandbox.io/s/solid-primitives-throttle-h2wni?file=/src/index.tsx
First version of the throttle primitive.
Cleaned up return types and documentation.
Adding CJS support to package.
Updated to Solid 1.3
General clean-up and improvements by Joe Pea (trusktr)