alewin/useWorker

⚛️ useWorker() - A React Hook for Blocking-Free Background Tasks

View on GitHub ↗Jump to charts ↓

alewin/useWorker has 3k+ stars and 100+ forks on GitHub, is written in JavaScript, and was last pushed on Jun 6, 2026. Data as of . Signed-in members get hourly updates — create a free account.

Summary Information

Updated 3 minutes ago
Type:Library / SDKCategory(s):Frontend FrameworksWeb Development
Added to GitGenius on September 22nd, 2026
Created on January 18th, 2020
Open Issues & Pull Requests: 30 (+0)
GitHub issues: Enabled
Number of forks: 106
Total Stargazers: 3,109 (+0)
Total Subscribers: 18 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 24.8 days
Mean response time: 204.6 days
90th percentile: 783.9 days
Tracked items: 28

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 14
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,428 days
Stale 30+ days: 14
Stale 90+ days: 14

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (12)
  • question (9)
  • to inspect :thinking: (7)
  • enhancement (3)
  • Proposal (2)
  • feature request (2)
  • RC useworker 5.0.0 (1)
  • transpiling related (1)

Most active issues this week

Sign in to see which issues are moving.
Sign in

Detailed Description

useWorker is a React Hook for running expensive computations in background threads without blocking the user interface.

The tool solves the problem of long-running JavaScript tasks freezing the UI by offloading them to Web Workers. It wraps the Web Worker API in a React Hook that accepts a function and returns a callable interface. Instead of managing event-based messaging, developers work with Promises, making the API more intuitive within React's declarative paradigm. The hook handles worker lifecycle management, including garbage collection of worker instances when they are no longer needed.

The tool suits React projects that need to perform computationally intensive operations—sorting large datasets, parsing files, or processing data—while keeping the interface responsive. It is particularly valuable for Create React App users who want to use Web Workers without ejecting and modifying webpack configuration. The library includes options for setting timeouts, loading remote dependencies into the worker context, and transferring objects efficiently. Anyone adopting it should understand that Web Workers have inherent limitations around what can be serialized and passed between threads, and the documentation explicitly covers these constraints.

The project maintains a clear roadmap with completed features including worker termination, reactive status tracking, timeout handling, and support for both remote and local script imports. Several planned features remain unimplemented, including a multi-worker hook variant and a file-based worker hook.