npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

eventrix

v2.10.2

Published

A system for managing the state of the application based on the events broadcast in the application

Downloads

233

Readme

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