All Projects → robinweser → Alveron

robinweser / Alveron

Licence: mit
Elm & Reason inspired state management for React

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Alveron

react-wisteria
Managing the State with the Golden Path
Stars: ✭ 18 (-68.42%)
Mutual labels:  state-management, state, context
React Workshop
⚒ 🚧 This is a workshop for learning how to build React Applications
Stars: ✭ 114 (+100%)
Mutual labels:  context, state-management, state
Contextism
😍 Use React Context better.
Stars: ✭ 141 (+147.37%)
Mutual labels:  context, state-management, state
Yewdux
Redux-like state containers for Yew apps
Stars: ✭ 58 (+1.75%)
Mutual labels:  context, state-management, state
Use Global Context
A new way to use “useContext” better
Stars: ✭ 34 (-40.35%)
Mutual labels:  context, state-management, state
Duix
A State Manager focused on KISS and Pareto's Principle
Stars: ✭ 48 (-15.79%)
Mutual labels:  state-management, state
alveron-old
Opinionated Elm-inspired Redux Component Architecture for React
Stars: ✭ 17 (-70.18%)
Mutual labels:  state-management, state
React Recomponent
🥫 Reason-style reducer components for React using ES6 classes.
Stars: ✭ 272 (+377.19%)
Mutual labels:  state-management, state
Machinery
State machine thin layer for structs (+ GUI for Phoenix apps)
Stars: ✭ 367 (+543.86%)
Mutual labels:  state-management, state
Redux Orm
A small, simple and immutable ORM to manage relational data in your Redux store.
Stars: ✭ 2,922 (+5026.32%)
Mutual labels:  state-management, state
Westore
更好的小程序项目架构
Stars: ✭ 3,897 (+6736.84%)
Mutual labels:  state-management, state
k-ramel
State manager for your components apps, the safe and easy way
Stars: ✭ 20 (-64.91%)
Mutual labels:  state-management, state
Nanny-State
simple state management
Stars: ✭ 68 (+19.3%)
Mutual labels:  state-management, state
Govern
Component-based state management for JavaScript.
Stars: ✭ 270 (+373.68%)
Mutual labels:  state-management, state
atomic-state
A decentralized state management library for React
Stars: ✭ 54 (-5.26%)
Mutual labels:  state-management, state
Effector
The state manager ☄️
Stars: ✭ 3,572 (+6166.67%)
Mutual labels:  state-management, state
Pullstate
Simple state stores using immer and React hooks - re-use parts of your state by pulling it anywhere you like!
Stars: ✭ 683 (+1098.25%)
Mutual labels:  state-management, state
Little State Machine
📠 React custom hook for persist state management
Stars: ✭ 654 (+1047.37%)
Mutual labels:  state-management, state
Redux Tree
An alternative way to compose Redux reducers
Stars: ✭ 23 (-59.65%)
Mutual labels:  state-management, state
xstate-viz
Visualizer for XState machines
Stars: ✭ 274 (+380.7%)
Mutual labels:  state-management, state

Alveron

Disclaimer: Alveron was formerly published as react-woodworm. It was renamed in order to replace the previous alveron package. The old react-woodworm version 4.0 is now published as alveron version 2.0. Sorry for the inconvenience.

Alveron is an Elm-inspired state management library for React support asynchronous effects by default.
It uses React's new context API and is super lightweight at only 1kb gzipped.
From version 3.0.0, it also provides a useAlveron hook.

It can handle both local component state as well as global state.

TravisCI Test Coverage npm downloads gzipped size npm version

Support Me

If you're using Robin Frischmann's packages, please consider supporting his Open Source Work on Patreon.

Installation

# yarn
yarn add alveron

# npm
npm i --save alveron

Caution: It requires ^[email protected] to be present.

Documentation

We recommend starting with Why and How to understand why Alveron exists and how it works.

Examples

The Gist

Want to use Alveron with hooks already? Check out Using Hooks.

import React from 'react'
import { createStore } from 'alveron'

const model = 0
const actions = {
  increment: prevState => prevState + 1,
  decrement: prevState => prevState - 1,
  reset: () => model
}

// It also supports async side effects
// this is useful if you e.g. do API calls
const effects = {
  resetAsync: actions => setTimeout(
    actions.reset,
    1000
  )
}

const { Wrapper } = createStore({
  model,
  actions,
  effects
})

const Counter = () => (
  <Wrapper>
    {({ state, actions, effects }) => (
      <div>
        Count: {state}
        <button onClick={actions.increment}>+</button>
        <button onClick={actions.decrement}>-</button>
        <button onClick={effects.resetAsync}>Reset after 1 second</button>
      </div>
    )}
  </Wrapper>
)

Users

License

Alveron is licensed under the MIT License.
Documentation is licensed under Creative Common License.
Created with ♥ by @rofrischmann.

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