Skip to content

┌─< lukebayliss.com >─┐

Snippets

code fragments, scripts, and quick references

  • Type-Safe Event Emitter

    A strongly-typed event emitter pattern for TypeScript that provides autocomplete and type checking for event names and payloads.

    patterns type-safety events
  • Retry with Exponential Backoff

    A generic retry utility with exponential backoff for handling transient failures in API calls and async operations.

    async error-handling utilities
  • Debounce and Throttle Utilities

    Type-safe debounce and throttle functions for controlling the rate of function execution in TypeScript.

    performance utilities react
  • Type-Safe useLocalStorage Hook

    A React hook for managing localStorage with TypeScript type safety, automatic JSON parsing, and sync across tabs.

    react hooks storage
  • Async Task Queue

    A concurrent task queue with rate limiting and priority support for managing async operations in TypeScript.

    async concurrency utilities