TemperTemper
SnippetsEditorCLI
SnippetsEditorCLI
GeneralUtilitiesAlgorithmsBoilerplates

Boilerplates

Runnable templates and starting points

Language:

#Async9

Debounce

Create a debounced function that delays execution until after a specified wait period has elapsed since the last call.

Memoize

Cache function results to avoid redundant calculations and improve performance for expensive operations.

Once

Create a function that can only be called once, returning the cached result for subsequent invocations.

Parallel with Limit

Run promises in parallel with a concurrency limit to control resource usage and prevent overwhelming external services.

Retry with Backoff

Retry an async function with exponential backoff to handle transient failures gracefully.

Sequential Promises

Execute async operations sequentially, ensuring each completes before starting the next.

Sleep

Pause execution for a specified number of milliseconds using a promise-based delay.

Throttle

Create a throttled function that limits the execution rate to at most once per specified time interval.

Timeout Promise

Add a timeout to any promise, rejecting with an error if the operation takes too long.