{"repo":"alewin/useWorker","free":true,"listed":false,"github":"https://github.com/alewin/useWorker","clone":"git clone https://github.com/alewin/useWorker.git","description":"⚛️ useWorker() - A React Hook for Blocking-Free Background Tasks","language":"JavaScript","stars":3113,"topics":["react","hooks","web-worker-react","useworker","web-workers","background","thread","hook","web-worker","typescript-library"],"license":"MIT","category":"ui-components","readme_excerpt":"Use web workers with react hook https://useworker.js.org/ --- 🎨 Features - Run expensive function without blocking UI (Show live gif) - Supports Promises pattern instead of event-messages - Size: less than 3KB ! - Clear API using hook - Typescript support - Garbage collector web worker instance - Remote dependencies option - timeout option --- 💾 Install - @latest --- 🔨 Import --- 📙 Documents - Getting Started - APIs - Examples - Limitations --- 🍞 Demo - Sorting: Sorting 50000 random numbers - Csv: Generate Csv, Parse Csv, Convert to JSON - External Dependencies Use external scripts inside WebWorker --- ⚙ Web Workers Before you start using this hook, I suggest you to read the Web Worker documentation. --- 🐾 Usage --- 🖼 Live Demo --- 🐾 Examples More examples: https://github.com/alewin/useWorker/tree/develop/example --- 🔧 Roadmap - [x] Kill Web Worker - [x] Reactive web worker status - [x] Add timeout option - [x] Import and use remote script inside useWorker function - [x] support Transferable Objects - [x] Testing useWorker #41 - [x] Import and use local script inside useWorker function #37 - [ ] useWorkers Hook #38 - [ ] useWorkerFile Hook #93 --- 🤔 Motivation and Limitations Most react projects are initialized through Create React App. CRA unfortunately does not offer support for webworkers, unless you eject and change the webpack configuration manually. This library allows you to use web workers without having to change the CRA configuration, which is why there ar","default_branch":null,"files":null,"tree":[],"storefront":"/r/alewin","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/alewin/useWorker/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}