{"id":15388548,"url":"https://github.com/deebloo/redux-web-worker","last_synced_at":"2025-04-15T20:21:31.817Z","repository":{"id":71870401,"uuid":"62473902","full_name":"deebloo/redux-web-worker","owner":"deebloo","description":"Redux implementation in a web worker","archived":false,"fork":false,"pushed_at":"2023-12-15T08:16:42.000Z","size":47,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T00:51:19.567Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deebloo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-02T23:43:36.000Z","updated_at":"2021-05-15T22:17:26.000Z","dependencies_parsed_at":"2024-10-18T20:00:17.085Z","dependency_job_id":"4ccacb65-dc44-4842-bfe9-fe377ca2bdfe","html_url":"https://github.com/deebloo/redux-web-worker","commit_stats":{"total_commits":35,"total_committers":1,"mean_commits":35.0,"dds":0.0,"last_synced_commit":"c6f98e708e2255aa1c659fce9ae69bdf56aa74c7"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deebloo%2Fredux-web-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deebloo%2Fredux-web-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deebloo%2Fredux-web-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deebloo%2Fredux-web-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deebloo","download_url":"https://codeload.github.com/deebloo/redux-web-worker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249145941,"owners_count":21220063,"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":[],"created_at":"2024-10-01T14:57:13.497Z","updated_at":"2025-04-15T20:21:31.795Z","avatar_url":"https://github.com/deebloo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redux-worker [![CircleCI](https://circleci.com/gh/deebloo/redux-web-worker.svg?style=svg)](https://circleci.com/gh/deebloo/redux-web-worker)\n\n```\nnpm i --save redux-web-worker\n```\n\nRedux implementation in a web worker (experiment).\nThe entire state is kept in a separate thread. (this also gives the added benefit of immutable objects)\n\n```TS\nimport { createStore } from 'redux-web-worker/core';\n// Or if using bundle.\n// var createStore = Rw.createStore;\n\n// the reduces is run in a new thread\nvar store = createStore((state, action) =\u003e {\n  switch(action.type) {\n    case 'INCREMENT':\n      return state + 1;\n    case 'DECREMENT':\n      return state - 1;\n    default:\n      return state;\n  }\n}, 0);\n\n// get state has to be async since the state is managed is a separate thread\nstore.getState(state =\u003e {\n  console.log(state) // 0\n});\n\n// subscribe to the store for changes.\n// the web worker acts as the dispatcher with onmessage and postMessage\nstore.subscribe(state =\u003e {\n  console.log(state);\n});\n\n// standard redux style dispatch\nstore.dispatch({ type: 'INCREMENT' });\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeebloo%2Fredux-web-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeebloo%2Fredux-web-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeebloo%2Fredux-web-worker/lists"}