All Projects → fabien-h → Acta

fabien-h / Acta

Licence: mit
Super light and dead simple state manager and event dispatcher for react.

Programming Languages

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

Projects that are alternatives of or similar to Acta

Daily Apps
Everything you see on Daily 👀
Stars: ✭ 141 (-9.03%)
Mutual labels:  frontend
Blog
一般不会写 API 类文章,努力写有营养的文章,喜欢请点 star
Stars: ✭ 146 (-5.81%)
Mutual labels:  frontend
Layerjs
layerJS: Javascript UI composition framework
Stars: ✭ 1,825 (+1077.42%)
Mutual labels:  frontend
Roadmap Web Developer 2017
Front-end (HTML5/CSS3/Javascript related) technologies to learn in 2017
Stars: ✭ 142 (-8.39%)
Mutual labels:  frontend
Weekly
前端精读周刊。帮你理解最前沿、实用的技术。
Stars: ✭ 16,996 (+10865.16%)
Mutual labels:  frontend
Kunafa
Easy to use, high level framework in Kotlin for front-end web-development
Stars: ✭ 148 (-4.52%)
Mutual labels:  frontend
Awesome Ember
A curated list of awesome Ember.js stuff like addons, articles, videos, gists and more.
Stars: ✭ 140 (-9.68%)
Mutual labels:  frontend
Niui
Lightweight, feature-rich, accessible front-end library
Stars: ✭ 152 (-1.94%)
Mutual labels:  frontend
Stpageflip
Simple library for creating realistic page turning effects
Stars: ✭ 146 (-5.81%)
Mutual labels:  frontend
Cloudstack Ui
Modern UI for Apache Cloudstack User Self Service Portal
Stars: ✭ 150 (-3.23%)
Mutual labels:  frontend
Overlayscrollbars
A javascript scrollbar plugin which hides native scrollbars, provides custom styleable overlay scrollbars and keeps the native functionality and feeling.
Stars: ✭ 2,054 (+1225.16%)
Mutual labels:  frontend
Spring Petclinic Angular
Angular 8 version of the Spring Petclinic sample application (frontend)
Stars: ✭ 145 (-6.45%)
Mutual labels:  frontend
Coloquent
Javascript/Typescript library mapping objects and their interrelations to JSON API, with a clean, fluent ActiveRecord-like (e.g. similar to Laravel's Eloquent) syntax for creating, retrieving, updating and deleting model objects.
Stars: ✭ 149 (-3.87%)
Mutual labels:  frontend
Frontend Download Sample
🎄 自己整理的一些项目中遇到过的关于上传和下载的一些Demo,仅供给位看官参考,避免踩坑,即插即用,欢迎fork和star🌟,为这个仓库添砖加瓦~(P.S. 个人认为如果没写过上传下载其实还是挺麻烦的~)
Stars: ✭ 142 (-8.39%)
Mutual labels:  frontend
Material Dashboard
Material Frontend Preset For Laravel Framework 8.x and Up
Stars: ✭ 152 (-1.94%)
Mutual labels:  frontend
Frontenddaily
前端开发博客,分享互联网最精彩的前端技术,欢迎关注我微信公众号:前端开发博客,回复 1024,领取前端进阶资料包,回复 加群,与大神一起交流学习。
Stars: ✭ 1,901 (+1126.45%)
Mutual labels:  frontend
Lazy
Kule Lazy4 / CSS Framework
Stars: ✭ 147 (-5.16%)
Mutual labels:  frontend
Javascript Sdk
Javascript SDK to communicate with Binance Chain.
Stars: ✭ 151 (-2.58%)
Mutual labels:  frontend
Angular2 Flask
Simple angular2 app with python-flask backend ( Learning Angular2 )
Stars: ✭ 152 (-1.94%)
Mutual labels:  frontend
Nightly.js
A zero dependency javascript library that enables the night mode in your website easily
Stars: ✭ 150 (-3.23%)
Mutual labels:  frontend


Acta logo


Super light dead simple state manager and event dispatcher for React. May you never ask yourself again "where are those props coming from?". Get to the quick start. Or watch the 2 minutes video.

short tutorial thumbnail


badgen minzip Coverage Status codacy code quality badgen typescript badgen types included badgen mit licence badgen npm version code style: prettier

  • Explicit over implicit.
  • Minimal dataflow: the component subscribing is the one using the data.
  • Zero setups, no provider or observable system.

Acta is providing

  • A unique global store with keys indexed values.
  • A one line straight forward way of subscribing to the application state in a class component Acta.subscribeState('appStateKey', 'localStateKey');.
  • A hook for functional components const valueFromActa = Acta.useActaState('appStateKey'); that share states with class components.
  • A simple way of setting / getting the state Acta.setState({appStateKey: value}).
  • A one line straight forward way of subscribing application events in a class component Acta.subscribeState('appEventKey', handler);.
  • A hook for functional components Acta.useActaEvent('appEventKey', handler); that share events. with class components.
  • A simple way of dispatching an event Acta.dispatchEvent('appEventKey', value).
  • Optional local/session storage persistence.
  • Shared states and events between tabs and windows.
  • Great performances since the store contains references to the callbacks instead of having to iterate on every reducer and stop only when it finds the corresponding ones.
  • Self-cleaning methods unsubscribing to states and events.
  • An exposed global object that you can call from anywhere without having to set up and pass providers, wrappers, or decorators.

In Acta states, you can store string, numbers, and booleans; in object literals and in arrays. Since all values stored have to be compatible with the local storage Maps, Sets or functions won’t work.

You don't need tooling to debug Acta. Just type Acta in your browser console and see the object and the internals.

Why another state manager?

React ecosystem already has excellent state managers. Redux and MobX are great tools. But teams tend to make a mess of their codebase with overcomplicated state management patterns because they have seen it work for big applications and online tutorials encouraging premature scaling optimizations.

Maintainability is the ability to make changes with confidence. If you cannot understand your dataflow instantly today and describe it in a simple sentence, it means that three months from now you will be lost in the layers of abstraction that you just created and that any modification will be a nightmare.

If an action calls a dispatcher to push updated data in a middleware that will look into a bunch of reducers to find the one that will transform the updated data to push them into a provider that will trigger a mapping from the transformed updated data into properties in a higher-order function that wraps the parent of the component where the data will be displayed... Well, congratulations, you made the life of the next guy hell. And this is not a caricature, some applications have way more complicated dataflow. Sometimes it's required; but if I bet that it's not your case, I'll be right 99.9% of the time.

The goal of Acta is to make you forget about reducers, observers, map to props, providers, HOCs... Components are explicitly responsible for subscribing to the state or event. You can call for a complex data treatment inside the component. You can have actions that will be triggered. But the incoming data flow should be the most direct possible.

forthebadge

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