{"id":13394443,"url":"https://github.com/klarna/electron-redux","last_synced_at":"2025-05-15T09:07:45.044Z","repository":{"id":37216283,"uuid":"70620807","full_name":"klarna/electron-redux","owner":"klarna","description":"Use redux in the main and browser processes in electron","archived":false,"fork":false,"pushed_at":"2024-10-29T16:03:23.000Z","size":2784,"stargazers_count":755,"open_issues_count":29,"forks_count":96,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-09T16:11:17.547Z","etag":null,"topics":["electron","klarna-featured","redux"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/klarna.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2016-10-11T17:58:49.000Z","updated_at":"2025-04-17T09:46:31.000Z","dependencies_parsed_at":"2024-01-25T16:04:44.506Z","dependency_job_id":"ee4cd95c-366e-4eb6-9552-0ef0c2b2d82b","html_url":"https://github.com/klarna/electron-redux","commit_stats":{"total_commits":206,"total_committers":16,"mean_commits":12.875,"dds":"0.36407766990291257","last_synced_commit":"cb87a03aca96aa81ab53d3d05cd44624f8d9a722"},"previous_names":["hardchor/electron-redux"],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klarna%2Felectron-redux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klarna%2Felectron-redux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klarna%2Felectron-redux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klarna%2Felectron-redux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klarna","download_url":"https://codeload.github.com/klarna/electron-redux/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254310515,"owners_count":22049469,"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":["electron","klarna-featured","redux"],"created_at":"2024-07-30T17:01:19.900Z","updated_at":"2025-05-15T09:07:40.034Z","avatar_url":"https://github.com/klarna.png","language":"TypeScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# electron-redux\n\nElectron-Redux is an Redux Store Enhancer that helps you loosely synchronize the redux stores in multiple electron processes.\n\nWhen working with Electron, using Redux poses couple of problems, since main and renderer processes are isolated and IPC is a single way of communication between them. This library, enables you to register all your Redux stores in the main \u0026 renderer process, and enable cross-process action dispatching \u0026 _loose_ store synchronization.\n\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/klarna/electron-redux/Release)](https://github.com/klarna/electron-redux/actions?query=workflow%3ARelease)\n[![npm (tag)](https://img.shields.io/npm/v/electron-redux)](https://www.npmjs.com/package/electron-redux/)\n[![npm](https://img.shields.io/npm/dm/electron-redux)](https://www.npmjs.com/package/electron-redux/)\n[![npm bundle size (version)](https://img.shields.io/bundlephobia/minzip/electron-redux)](https://bundlephobia.com/result?p=electron-redux)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n\n## Installation\n\n```sh\n# with yarn\nyarn add electron-redux\n\n# with npm\nnpm install electron-redux\n```\n\nFor more details, please see [the Installation docs page](#todo).\n\n## Documentation\n\nelectron-redux docs are located at **electron-redux.js.org**. You can find there:\n\n-   [Getting started](#todo)\n-   [Recipes](#todo)\n-   [API Reference](#todo)\n\n## Quick start\n\n### Basic setup\n\nIf you have a setup without any enhancers, also including middleware, you can use the basic setup. For the basic setup, electron redux exposes a [Redux StoreEnhancer](https://redux.js.org/understanding/thinking-in-redux/glossary#store-enhancer). You simply add the enhancer to your createStore function to set it up.\n\n```ts\n// main.ts\nimport { stateSyncEnhancer } from 'electron-redux'\n\nconst store = createStore(reducer, stateSyncEnhancer())\n```\n\n```ts\n// renderer.ts\nimport { stateSyncEnhancer } from 'electron-redux'\n\nconst store = createStore(reducer, stateSyncEnhancer())\n```\n\n### Multi-enhancer setup\n\n\u003e This setup is required when you have other enhancers/middleware. This is especially the case for enhancers or middleware which dispatch actions, such as **redux-saga** and **redux-observable**\n\nFor this setup we will use the `composeWithStateSync` function. This function is created to wrap around your enhancers, just like the [compose](https://redux.js.org/api/compose) function from redux. When using this, you will not need `stateSyncEnhancer` as this does the same thing under the hood. If you do, it will throw an error.\n\n```ts\nimport { createStore, applyMiddleware, compose } from 'redux'\nimport { composeWithStateSync } from 'electron-redux'\n\nconst middleware = applyMiddleware(...middleware)\n\n// add other enhances here if you have any, works like `compose` from redux\nconst enhancer: StoreEnhancer = composeWithStateSync(middleware /* ... other enhancers ... */)\n\nconst store = createStore(reducer, enhancer)\n```\n\nThat's it!\n\nYou are now ready to fire actions from any of your processes, and depending on the [scope](#scoped-actions) the main store will broadcast them across your application.\n\nPlease check out the [docs](#todo) for more recipes and examples!\n\n## Actions\n\nActions fired **MUST be [FSA](https://github.com/acdlite/flux-standard-action#example)-compliant**, i.e. have a `type` and `payload` property. Any actions not passing this test will be ignored and simply passed through to the next middleware.\n\n\u003e Nota bene, `redux-thunk` is not FSA-compliant out of the box, but can still produce compatible actions once the async action fires.\n\nFurthermore, actions (and that includes payloads) **MUST be serializable**.\n\n\u003e You can extend default JSON serialization used, by [providing your own serialization/deserialization functions](#todo).\n\n### Scoped actions\n\nBy default, all actions are broadcast to all registered stores. However, some state should only live in the renderer (e.g. `isPanelOpen`). electron-redux introduces the concept of action scopes.\n\nTo stop an action from propagating from renderer to main store, simply set the scope to local by decorating your action with `stopForwarding` function. Read more about it in the [docs](#todo)\n\n### Blocked actions\n\nBy default, some of the actions are blocked from broadcasting / propagating, those include actions starting with `@@` and `redux-form`. The list of ignored actions can be modified with [options](#todo).\n\n## Changelog\n\nThis project adheres to [Semantic Versioning](http://semver.org/).\nEvery release, along with the migration instructions, is documented on the GitHub [Releases](https://github.com/klarna/electron-redux/releases) page.\n\n## Contributing\n\nContributions via [issues](https://github.com/klarna/electron-redux/issues/new) or [pull requests](https://github.com/klarna/electron-redux/compare) are hugely welcome! Remember to read our [contributing guidelines](.github/CONTRIBUTING.md) to get started!\n\nBy contributing to electron-redux, you agree to abide by [the code of conduct](.github/CODE_OF_CONDUCT.md).\n\n## License\n\n[MIT](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklarna%2Felectron-redux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklarna%2Felectron-redux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklarna%2Felectron-redux/lists"}