All Projects → rstgroup → eventrix

rstgroup / eventrix

Licence: MIT license
Open-source, Predictable, Scaling JavaScript library for state managing and centralizing application global state. State manage system for react apps.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to eventrix

Pullstate
Simple state stores using immer and React hooks - re-use parts of your state by pulling it anywhere you like!
Stars: ✭ 683 (+1851.43%)
Mutual labels:  hooks, state-management, state
jedisdb
redis like key-value state management solution for React
Stars: ✭ 13 (-62.86%)
Mutual labels:  hooks, state-management, state
useSharedState
useSharedState is a simple hook that can be used to share state between multiple React components.
Stars: ✭ 0 (-100%)
Mutual labels:  hooks, state-management, state
atomic-state
A decentralized state management library for React
Stars: ✭ 54 (+54.29%)
Mutual labels:  hooks, state-management, state
Use Global Context
A new way to use “useContext” better
Stars: ✭ 34 (-2.86%)
Mutual labels:  hooks, state-management, state
Pure Store
A tiny immutable store with type safety.
Stars: ✭ 133 (+280%)
Mutual labels:  hooks, state-management, state
react-cool-form
😎 📋 React hooks for forms state and validation, less code more performant.
Stars: ✭ 246 (+602.86%)
Mutual labels:  hooks, state-management, state
stook
A minimalist design state management library for React.
Stars: ✭ 86 (+145.71%)
Mutual labels:  hooks, state-management
teaful
🍵 Tiny, easy and powerful React state management
Stars: ✭ 638 (+1722.86%)
Mutual labels:  state-management, state
RxReduxK
Micro-framework for Redux implemented in Kotlin
Stars: ✭ 65 (+85.71%)
Mutual labels:  state-management, state
vuex-but-for-react
A state management library for React, heavily inspired by vuex
Stars: ✭ 96 (+174.29%)
Mutual labels:  state-management, state
react-zeno
The React companion to Zeno, a Redux implementation optimized for Typescript.
Stars: ✭ 14 (-60%)
Mutual labels:  hooks, state-management
use-query-string
🆙 A React hook that serializes state into the URL query string
Stars: ✭ 50 (+42.86%)
Mutual labels:  hooks, state-management
use-app-state
🌏 useAppState() hook. that global version of setState() built on Context.
Stars: ✭ 65 (+85.71%)
Mutual labels:  hooks, state-management
restate
A redux fractal state library 🕷
Stars: ✭ 55 (+57.14%)
Mutual labels:  state-management, state
react-coat-ssr-demo
Demo with Typescript + React + Redux for server-side-rendering (SSR)
Stars: ✭ 100 (+185.71%)
Mutual labels:  state-management, ssr
concave
🧐 Lens-like state management (for React).
Stars: ✭ 13 (-62.86%)
Mutual labels:  state-management, state
riduce
Get rid of your reducer boilerplate! Zero hassle state management that's typed, flexible and scalable.
Stars: ✭ 14 (-60%)
Mutual labels:  state-management, state
reactive state
An easy to understand reactive state management solution for Flutter.
Stars: ✭ 19 (-45.71%)
Mutual labels:  state-management, state
particule
Fine-grained atomic React state management library
Stars: ✭ 31 (-11.43%)
Mutual labels:  state-management, state

Eventrix

STATE MANAGMENT FOR REACT AND REACT NATIVE APPS

Build Status npm npm

Support

  • React
  • React Native
  • SSR (Next.js)

Installation

$ npm install eventrix --save

Documentation

Get started | API | Migration from Redux | Demo

Home page

We have website dedicated to eventrix. Go to eventrix.io and see what eventrix has to offer.

Quickstart

eventrixStore.js

import { Eventrix } from 'eventrix';
import receiversList from './receivers';

const initialState = {
    users: [],
};

const eventrixStore = new Eventrix(initialState, receiversList);
export default eventrixStore;

App.jsx

import { StrictMode } from "react";
import ReactDOM from "react-dom";
import { EventrixProvider } from 'eventrix';
import eventrixStore from './eventrixStore';

const rootElement = document.getElementById("root");
ReactDOM.render(
    <StrictMode>
      <EventrixProvider eventrix={eventrixStore}>
        <UsersList />
      </EventrixProvider>
    </StrictMode>,
    rootElement
);

UsersList.jsx

import React, { useCallback } from 'react';
import { useEventrixState, useEmit } from 'eventrix';


const UsersList = () => {
    const [users] = useEventrixState('users');
    const emit = useEmit();
    const fetchUsers = useCallback(() => {
        emit('fetchUsers');
    }, [emit]);
    
    return (
        <div>
            <button onClick={fetchUsers}></button>
            <div>
                {users.map(user => <div key={user.id}>{user.name} {user.surname}</div>)}
            </div>
        </div>
    )
}

receivers.js

import axios from 'axios';
import { EventsReceiver } from 'eventrix';

const fetchUsersReceiver = new EventsReceiver('fetchUsers', (eventName, eventData, stateManager) => {
    return axios.get('https://myDomain.com/users').then((response) => {
        const usersList = response.data;
        stateManager.setState('users', usersList);
    });
});

const receiversList = [fetchUsersReceiver];

export default receiversList;

About

Eventrix is a scaling and predictable JS library for state managing and centralizing application global state.

Eventrix 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.

If 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.

The biggest advantages to REDUX TOOLKIT are:

  • CPU 50% EVENTRIX REDUCE CPU USAGE
  • FPS 100% EVENTRIX BETTER THAN REDUX TOOLKIT
  • JS Heap size 51% EVENTRIX BETTER THAN REDUX TOOLKIT
  • Action in time x5 EVENTRIX BETTER THAN REDUX TOOLKIT

Check it yourself using those tools:

Video of how it works and a performance comparison: React REDUX vs Eventrix performance test

Greater control of data flow thanks to additional tools (devtools) and a small threshold of entry (small amount of code to write): Eventrix DevTools

Contribute

  • use eslint rules
  • write clean code
  • unit tests (min 85% of your code should be tested)
  • code of conduct

License

eventrix package are MIT licensed

Powered by

RST Software Masters look on RST Github

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].