All Projects → dashersw → Regie

dashersw / Regie

Licence: mit
An observable state management tool for vanilla JS applications based on Proxies

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Regie

Elfi
An elegant state container for your JavaScript applications
Stars: ✭ 18 (-45.45%)
Mutual labels:  state-management
Stabs
tabs in vanilla JS
Stars: ✭ 9 (-72.73%)
Mutual labels:  vanilla-js
Useredcontext
A Flux/Redux replacer - written with useContext and useReducer hooks.
Stars: ✭ 20 (-39.39%)
Mutual labels:  state-management
Redux Tree
An alternative way to compose Redux reducers
Stars: ✭ 23 (-30.3%)
Mutual labels:  state-management
Platform
Reactive libraries for Angular
Stars: ✭ 7,020 (+21172.73%)
Mutual labels:  state-management
React Pocket
A framework that enables you to use intimate jquery-style APIs in React instead of using redux. Light, simple and easy🍹
Stars: ✭ 11 (-66.67%)
Mutual labels:  state-management
Inherited builder
🤖Autogenerated state management and dependency injection with inherited widgets
Stars: ✭ 17 (-48.48%)
Mutual labels:  state-management
Mvvm Redux
MVVM Redux is a lightweight lib to help you apply the redux concepts in your project based in MVVM.
Stars: ✭ 30 (-9.09%)
Mutual labels:  state-management
Bloc
A predictable state management library that helps implement the BLoC design pattern
Stars: ✭ 8,214 (+24790.91%)
Mutual labels:  state-management
Concent
State management that tailored for react, it is simple, predictable, progressive and efficient.
Stars: ✭ 882 (+2572.73%)
Mutual labels:  state-management
Search Ui
🔍 A set of UI components to build a fully customized search!
Stars: ✭ 24 (-27.27%)
Mutual labels:  vanilla-js
Revuejs
🐇 A tiny, light and handy state management for vuejs 2, writing less verbose code.
Stars: ✭ 25 (-24.24%)
Mutual labels:  state-management
Awesome React Context
😎 A curated list of stuff related to the new React Context API
Stars: ✭ 865 (+2521.21%)
Mutual labels:  state-management
Vue Entity Adapter
Package to maintain entities in Vuex.
Stars: ✭ 20 (-39.39%)
Mutual labels:  state-management
Vanilla Emoji Picker
Modern emoji picker. Super light 2kb gzipped, simple and no frameworks 😻
Stars: ✭ 20 (-39.39%)
Mutual labels:  vanilla-js
React Eventmanager
[Deprecated] Event-based simple React state management with decorators
Stars: ✭ 17 (-48.48%)
Mutual labels:  state-management
Mobius
A functional reactive framework for managing state evolution and side-effects.
Stars: ✭ 855 (+2490.91%)
Mutual labels:  state-management
Mini Rx Store
Lightweight Redux Store based on RxJS
Stars: ✭ 32 (-3.03%)
Mutual labels:  state-management
Learn Vanilla Js
Open source list of paid & free resources to learn vanilla JavaScript
Stars: ✭ 945 (+2763.64%)
Mutual labels:  vanilla-js
Revived
A redux-inspired predictable state container for python
Stars: ✭ 12 (-63.64%)
Mutual labels:  state-management

regie

npm version Build Status Coverage Status dependencies Status GitHub license

An observable state management tool for vanilla JS applications based on Proxies

Example

const regie = require('regie')

const initialState = {
  items: []
}

const { state, observe } = regie({ initialState })

observe(state.items, (newValue, change) => {
  console.log(`new value is ${newValue} with change:`, change)
})

state.items.push('first!')

Installation

npm i regie

Usage

observe function accepts many forms, including a string path and a predicate. All of the following are the same:

const regie = require('regie')

const initialState = {
  items: []
}

const { state, observe } = regie({ initialState })

observe(state.items, handler)
observe(state => state.items, handler)
observe(() => state.items, handler)
observe('items', handler)

const items = state.items

observe(items, handler)
observe(() => items, handler)

regie also allows you to watch primitive values in a certain form. The following examples observe the future first element of the array:

observe(() => state.items[0], handler)
observe('items.0', handler)

and the following examples observe even farther into the future details of the first element of the array:

observe(() => state.items[0].name, handler)
observe('items.0.name', handler)

License

MIT License

Copyright (c) 2019 Armagan Amcalar

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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