Git Product home page Git Product logo

event-storm's Introduction

publish codecov

Introduction to Event Storm

The Event Storm is a tiny store implementation with pure javascript. Event Storm will help to organize and manage your application's state. The library is deigned to be framework and platform agnotics, which empowers an ability to use it, in any Javascript runtime.

There is an official React wrapper of the Event Storm.

When to use Event Storm?

  • Large scale application with a lot of data consumers(1K+)
  • The application is doing a lot of CPU intensive computations
  • The bundle size limited applications(library size 2kb)
  • Microservice applications(no matter using the same technology for microservices or not)

Installation

To install the library run:

# npm
npm i event-storm

# yarn
yarn add event-storm

Simple example

import { createStorm } from 'event-storm';

const defaultState = {
  name: 'Event Storm',
  isActive: false,
}

const storm = createStorm(defaultState);

// subscribing to listen all the changes
storm.subscribe((state, access) => console.log(access(storm)));

// subscribing to listen only partial changes
storm.subscribe((state, access) => console.log(access(storm.name)));

// update the state
storm.dispatch({ name: 'Event Storm - manage your state effectively' });

// use previous state to make the updates
storm.dispatch(prev => ({ isActive: !prev.isActive }));

See it in action

Examples:

event-storm's People

Contributors

artur93gev avatar dependabot-preview[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

event-storm's Issues

Provided API

Description

There must be consistent API between the provided models, store, etc.

Describe the solution you'd like

The solution must support the composition

Equality function

Description

Allow changing the comparison function

Describe the solution you'd like

it would be created to have the comparison on init and on subscribe also

addMiddlewares callback third argument

Description

addMiddleware(someModel)(callback)
The problem is that middleware callback should support the third argument, like options, for implementing time travel and passing additional props with publisher actions, in the previous version it works fine, now it throws a typescript error because 3rd argument doesn't exist.

Describe the solution you'd like

add typescript annotations for 3rd argument

Store primitive value changes

Description

Allow changing the primitive values without any feature degradation

Describe the solution you'd like

any value change must be acceptable

Logger

Description

Improve logger

Describe the solution you'd like

Logging mechanism must give more insights to the developer

Extra arguments for publishing

Description

Allow having the published arguments to be accepted in the subscribe method

Describe the solution you'd like

The API must be the same as for models

Type Declarations

Short description

The provided types declaration file does not match the existing API

๐Ÿ”ฌ Minimal Reproduction

usage of virtualModel or createStore will allow seeing the problems

Actual Behavior

The types are incorrect and not allow passing some needed arguments

Expected Behavior

all the features must be supported with typescript also

Store segmentation

Description

Store segmentation does not work on nested state updates

Describe the solution you'd like

The store segment must update only on non-duplicate changes(by default)

Subscription to store fragments

Description

Implement a single API to have subscription to store

Describe the solution you'd like

Any store fragment must be accessed via a single function. It would be great to have multiple exit points(e.g. object)

Documentation

Description

Update the readme documents

Describe the solution you'd like

Readme document must have exact match with the existing programmatic API

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.