{"id":13511319,"url":"https://github.com/rstgroup/eventrix","last_synced_at":"2025-04-03T03:10:26.570Z","repository":{"id":37862242,"uuid":"267431688","full_name":"rstgroup/eventrix","owner":"rstgroup","description":"Open-source, Predictable, Scaling JavaScript library for state managing and centralizing application global state. State manage system for react apps.","archived":false,"fork":false,"pushed_at":"2024-06-30T21:16:45.000Z","size":253,"stargazers_count":91,"open_issues_count":2,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-30T08:18:13.626Z","etag":null,"topics":["hooks","javascript","react","react-native","reactjs","ssr","state","state-management"],"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/rstgroup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"docs/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},"funding":{"github":"mprzodala"}},"created_at":"2020-05-27T21:38:55.000Z","updated_at":"2023-10-25T14:11:25.000Z","dependencies_parsed_at":"2022-09-10T19:00:31.346Z","dependency_job_id":"95b15432-cb02-452a-b75a-cb1f10f6df7a","html_url":"https://github.com/rstgroup/eventrix","commit_stats":{"total_commits":204,"total_committers":9,"mean_commits":"22.666666666666668","dds":0.6617647058823529,"last_synced_commit":"d5214551b930a036fe72b1a54e2086c86ad76056"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstgroup%2Feventrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstgroup%2Feventrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstgroup%2Feventrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstgroup%2Feventrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rstgroup","download_url":"https://codeload.github.com/rstgroup/eventrix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246927835,"owners_count":20856198,"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":["hooks","javascript","react","react-native","reactjs","ssr","state","state-management"],"created_at":"2024-08-01T03:00:47.263Z","updated_at":"2025-04-03T03:10:26.551Z","avatar_url":"https://github.com/rstgroup.png","language":"TypeScript","readme":"![Eventrix](assets/logo_br.svg)\n\nState Management for **React** and **React Native** Applications\n\n[![Build Status](https://travis-ci.org/rstgroup/eventrix.svg?branch=master)](https://travis-ci.org/rstgroup/eventrix)\n[![npm](https://img.shields.io/npm/l/eventrix.svg)](https://npmjs.org/package/eventrix)\n[![npm](https://img.shields.io/npm/v/eventrix.svg)](https://npmjs.org/package/eventrix)\n\n# Support\n- React\n- React Native\n- SSR (Next.js)\n\n# Installation\n\n```bash\n$ npm install eventrix --save\n```\n\n# Documentation\n\n[**Get started**](https://eventrix.gitbook.io/eventrix/getting-started)\n|\n[**API**](https://eventrix.gitbook.io/eventrix/hooks/useeventrixstate)\n|\n[**Migration from Redux**](https://eventrix.gitbook.io/eventrix/redux-greater-than-eventrix)\n|\n[**Demo**](https://eventrix.gitbook.io/eventrix/demo)\n\n# Home page\n\nWe have website dedicated to eventrix. Go to [**eventrix.io**](https://eventrix.io) and see what eventrix has to offer.\n\n# Quickstart\n\n```js\n// eventrixStore.js\n\nimport { Eventrix } from 'eventrix';\nimport receiversList from './receivers';\n\nconst initialState = {\n    users: [],\n};\n\nconst eventrixStore = new Eventrix(initialState, receiversList);\nexport default eventrixStore;\n```\n\n```jsx harmony\n// App.tsx\n\nimport { StrictMode } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { EventrixProvider } from 'eventrix';\nimport eventrixStore from './eventrixStore';\n\nconst rootElement = document.getElementById(\"root\");\nReactDOM.render(\n    \u003cStrictMode\u003e\n      \u003cEventrixProvider eventrix={eventrixStore}\u003e\n        \u003cUsersList /\u003e\n      \u003c/EventrixProvider\u003e\n    \u003c/StrictMode\u003e,\n    rootElement\n);\n```\n\n```jsx harmony\n// UsersList.jsx\n\nimport React, { useCallback } from 'react';\nimport { useEventrixState, useEmit } from 'eventrix';\n\n\nconst UsersList = () =\u003e {\n    const [users] = useEventrixState('users');\n    const emit = useEmit();\n    const fetchUsers = useCallback(() =\u003e {\n        emit('fetchUsers');\n    }, [emit]);\n    \n    return (\n        \u003cdiv\u003e\n            \u003cbutton onClick={fetchUsers}\u003e\u003c/button\u003e\n            \u003cdiv\u003e\n                {users.map(user =\u003e \u003cdiv key={user.id}\u003e{user.name} {user.surname}\u003c/div\u003e)}\n            \u003c/div\u003e\n        \u003c/div\u003e\n    )\n}\n```\n\n```js\n// receivers.js\n\nimport axios from 'axios';\nimport { EventsReceiver } from 'eventrix';\n\nconst fetchUsersReceiver = new EventsReceiver('fetchUsers', (eventName, eventData, stateManager) =\u003e {\n    return axios.get('https://myDomain.com/users').then((response) =\u003e {\n        const usersList = response.data;\n        stateManager.setState('users', usersList);\n    });\n});\n\nconst receiversList = [fetchUsersReceiver];\n\nexport default receiversList;\n```\n\nFor more usage examples see the `examples` directory.\n\n# About\n\n[Eventrix](https://eventrix.io/) is a scaling and predictable JS library for state managing and centralizing application global state.\n\nEventrix solves the problem of sharing information between elements of the application, as well as communication between them. This open source library is suitable for both very large and small applications. Eventrix enables flexible expansion of the global state as well as enables greater control over the data flow in the application.\n\nIf you need to manage a state that is shared between services and components in an app, Eventrix is the best solution available. Similar to a message broker for fronted with an addition allowing to manage the global states, it also enables these elements to communicate through events.\n\nThe biggest advantages to REDUX TOOLKIT are:\n- CPU 50% EVENTRIX REDUCE CPU USAGE\n- FPS 100% EVENTRIX BETTER THAN REDUX TOOLKIT\n- JS Heap size 51% EVENTRIX BETTER THAN REDUX TOOLKIT\n- Action in time x5 EVENTRIX BETTER THAN REDUX TOOLKIT\n\nCheck it yourself using those tools:\n- [Eventrix Performance Test App](http://eventrix-test.proserwit.pl/?q=100\u0026s=20)\n- [Redux Performance Test App](http://redux-test.proserwit.pl/?q=100\u0026s=20)\n- [Redux Performance Test App](http://redux-toolkit-test.proserwit.pl/?q=100\u0026s=20)\n\nVideo of how it works and a performance comparison:\n[React REDUX vs Eventrix performance test](https://www.youtube.com/watch?v=Vq-CS6hoK7I)\n\nGreater control of data flow thanks to additional tools (devtools) and a small threshold of entry (small amount of code to write):\n[Eventrix DevTools](https://github.com/rstgroup/eventrix-devtools)\n\n\n# Contribute\n\n- use eslint rules\n- write clean code\n- unit tests (min 85% of your code should be tested)\n\n## Development\n\nTo start development, clone the repository and install the dependencies. Then you can develop the library using the example application.\n\n```bash\n$ git clone https://github.com/rstgroup/eventrix.git\n$ npm install\n\n# Run the example application\ncd examples/todo-list\nnpm install\nnpm run dev\n```\n\nFor more example applications see the `examples` directory.\n\n# License\n\neventrix package are [MIT licensed](https://github.com/rstgroup/eventrix/blob/master/LICENSE)\n\n# Powered by\n\n[RST Software](https://rst.software), see our [Github](https://github.com/rstgroup)\n","funding_links":["https://github.com/sponsors/mprzodala"],"categories":["react"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frstgroup%2Feventrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frstgroup%2Feventrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frstgroup%2Feventrix/lists"}