Slacker

Slacker is a data-lazy-loading component designed to dramatically improve initial load performance in large applications. It pairs with Observer to run a loader only when the component enters the viewport—deferring expensive API calls or dynamic imports until they are needed. Slacker includes built-in retry and error handling strategies to make deferred loading resilient.

Basic usage#

Provide a loader function; when the element becomes visible the loader runs and its result is passed to children. This is ideal for lazy-loading large image sets, widgets, or section-level data.

Error handling & retries#

Pass an errorFallback function to receive the error info and a retry callback for custom UI. Configure maxRetries and backoff settings to automatically retry transient failures.

Components - Control Flow Utilities | ilokesto - React Library Collection