{"id":21942667,"url":"https://github.com/zonayedpca/react-web-workers","last_synced_at":"2025-04-22T18:42:42.313Z","repository":{"id":35093905,"uuid":"205765899","full_name":"zonayedpca/react-web-workers","owner":"zonayedpca","description":"Simplest way to include web workers with your React Application and get smoother experience ","archived":false,"fork":false,"pushed_at":"2022-12-11T04:03:10.000Z","size":3227,"stargazers_count":8,"open_issues_count":34,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T17:41:26.514Z","etag":null,"topics":["react-web-worker","react-web-workers","web-worker","web-worker-react","web-workers"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zonayedpca.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-02T02:54:56.000Z","updated_at":"2023-09-14T17:48:57.000Z","dependencies_parsed_at":"2023-01-15T13:45:21.482Z","dependency_job_id":null,"html_url":"https://github.com/zonayedpca/react-web-workers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonayedpca%2Freact-web-workers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonayedpca%2Freact-web-workers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonayedpca%2Freact-web-workers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonayedpca%2Freact-web-workers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zonayedpca","download_url":"https://codeload.github.com/zonayedpca/react-web-workers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249536491,"owners_count":21287609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react-web-worker","react-web-workers","web-worker","web-worker-react","web-workers"],"created_at":"2024-11-29T03:26:02.580Z","updated_at":"2025-04-22T18:42:42.265Z","avatar_url":"https://github.com/zonayedpca.png","language":"JavaScript","readme":"# react-web-workers\n\n\u003e A Simple Library to use web worker with your React Application Easily\n\n## Intro\n\nIf you are using some expensive processes inside your webpage, make sure you don't compromise your performance there. Web workers can make your web page feel smooth and realistic\n\n## Install\n\nInstalling this package is super simple and just like any other package. If you are using npm:\n```\nnpm i react-web-workers\n```\n\nBut if you are yarn lover:\n```\nyarn add react-web-workers\n```\n\n## Workers\n\nCreate as many workers as you want as a function and export them just like this:\n```javascript\nconst message = () =\u003e {\n  let text = 'Hello I am Your Web Worker'\n\n  const sentData = () =\u003e {\n    // eslint-disable-next-line no-restricted-globals\n    self.postMessage({ text })\n  }\n\n  // eslint-disable-next-line no-restricted-globals\n  self.onmessage = ({ data }) =\u003e {\n    console.log(data)\n    sentData()\n  }\n}\n\nexport default message;\n```\n\n## Work with Workers\n\nOnce your workers are ready, import ```react-web-workers```\n```javascript\nimport WebWorker from 'react-web-workers';\n```\n\nAlso import your workers:\n```javascript\nimport message from './workers/message';\n...\n```\n\nPass the workers directly as an array:\n```javascript\nconst [messageWorker, ...] = WebWorker([message, ...]);\n```\n\nNow you have access to all the web workers functionality with this ```messageWorker``` and all the other workers you've been working with\n\nIn case if you're feeling any difficulty, please refer to the example we have in this project.\n\n## Features\n\n- Simple to Use\n- Just import and start using\n- All the default functionality is kept\n- Create your worker function and export it  \n\n## Examples\n\n- Here's an Example of this library [Example](https://github.com/https://github.com/zonayedpca/react-web-workers/tree/master/example)\n- Here's an Example of web worker in Action [Web Worker in Action](https://github.com/zonayedpca/web-workers)\n\n## License\n\nMIT © [Zonayed Ahmed](https://github.com/zonayedpca)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzonayedpca%2Freact-web-workers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzonayedpca%2Freact-web-workers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzonayedpca%2Freact-web-workers/lists"}