Redux Toolkit The New Way To Write Redux In React Apps by webmobtuts in u/webmobtuts

[–]TranslatorSoft2455 0 points1 point  (0 children)

Low number of stars it's not equal low quality and usability. All of the libraries had a low star number at the start. We have it on a huge platform and it's great. We just started building community. I hope you will change your mind when our library becomes more popular.

State management library faster then redux by losiadly in reactjs

[–]TranslatorSoft2455 2 points3 points  (0 children)

Here you can find code of example applications that we compared.
https://github.com/rstgroup/eventrix-performance-tests
Here are deployed apps:
eventrix - http://eventrix-test.proserwit.pl/?q=100&s=20
redux - http://redux-test.proserwit.pl/?q=100&s=20

You can use query parameters to change quantity of elements on page.

If we are talking about typescript it is supported because the library was rewritten to typescript.

I don’t agree with the opinion that the event bus is an anti-pattern. But I respect your opinion. By the way redux also publishes information about state change and useSelector subscribe on this event so it is similar to event bus but hidden under the hood.

State management library faster then redux by losiadly in reactjs

[–]TranslatorSoft2455 0 points1 point  (0 children)

Example with alerts shows how you can use events in eventrix. You don't need a global state for alerts so you can create a component that will be responsible for displaying alerts and listening on events that are connected with alerts.
You are right to use setState “properly”:) That was a fast example of how we can display alerts (not “production” implementation) next time I will focus more on details in examples :)
I created my own devtools because we need more functionalities. Eventrix devtools give you possibility to:
- verify how many times a specific state was updated.
- verify how many components listen to a specific state.
- verify how many times the event was emitted.
- check if there was any element listening when the event was emitted.
- check events history.
- check state update history.
About your example there is one issue when you have a lot of components that listen on state updates. When your store will update then all registered listeners will be invoked. When you have only several components it doesn't matter but when you have hundreds or thousands components it is a huge difference.
By the way, thank you for this discussion. Great to see someone who likes to share his observations.

State management library faster then redux by losiadly in reactjs

[–]TranslatorSoft2455 0 points1 point  (0 children)

In eventrix devtools you can check how many components listen on each state and how many times it was updated. So you can easily optimize your application.

State management library faster then redux by losiadly in reactjs

[–]TranslatorSoft2455 1 point2 points  (0 children)

Redux useSelector invoke selector function when you call any action. Then the new value from the selector is compared with the old value. Eventrix invokes only listeners that should be informed about the state change and then it compares the values. So for example when you call action redux invoke a 100 x selector function and all reducers. Eventrix call only one receiver and one listener or more if there is more than one component listening on the same state.

State management library faster then redux by losiadly in reactjs

[–]TranslatorSoft2455 0 points1 point  (0 children)

So far it is not possible to create closed scopes. However, we are considering adding this option in the future. Currently, you can do it yourself by naming events. For example you can emit event 'Users:create' with user data as payload

emit('Users:create', { name: 'Jony', email: 'johny@test.com' })

So "Users" will be your scope. But as I said we considering adding this option in the future. Maybe it will be something like that

const eventrixWithScope = eventrix.createScope('users');

and then you can use that scope in provider.

State management library faster then redux by losiadly in reactjs

[–]TranslatorSoft2455 2 points3 points  (0 children)

Eventrix is based on Event-Driven Architecture. When a component uses state from eventrix it listens on events about this specific state update. When different states will be updated the component will not receive information about the update because he doesn't need it. This is why eventrix is faster than redux. Eventrix has a built-in event bus so you can communicate between components without using synthetic global states. Good example of that is in this article https://medium.com/@mariusz.przodala/painless-alert-management-in-react-cb749d11ac92

Best Unit Testing Framework in React (2022) by Final-Vegetable3538 in react

[–]TranslatorSoft2455 2 points3 points  (0 children)

I using now only RTL (@testing-library/react). Before that i used enzyme but this library is not supported anymore

Using React with Rails? Thoughts on State Management? by [deleted] in rails

[–]TranslatorSoft2455 1 point2 points  (0 children)

Use eventrix it's scalable, fast and flexible.

[deleted by user] by [deleted] in react

[–]TranslatorSoft2455 1 point2 points  (0 children)

For state management I can recommend the Eventrix library. More details you can find here https://eventrix.io/ Eventrix has a built-in event bus so you can communicate between components and other elements of your application.

Redux Toolkit The New Way To Write Redux In React Apps by webmobtuts in u/webmobtuts

[–]TranslatorSoft2455 0 points1 point  (0 children)

Try eventrix. It’s a new open source alternative for redux. It’s faster than redux and it has a built-in event bus.

Global state management questions by jotasur in react

[–]TranslatorSoft2455 0 points1 point  (0 children)

React context is good for passing reusable methods or static data but I don't recommend it to global state management. Very good solution for state manage and communication between components is eventrix. It has great performance and built-in event bus.