An open API service indexing awesome lists of open source software.

https://github.com/yuriyyakym/awai

Promised state management library with a unique events system, where every event is thennable, which allows to write logic in a saga-like way using async functions
https://github.com/yuriyyakym/awai

atomic effects management race-conditions react state state-management

Last synced: 5 months ago
JSON representation

Promised state management library with a unique events system, where every event is thennable, which allows to write logic in a saga-like way using async functions

Awesome Lists containing this project

README

          


Awai

Dependency-free state management library









| Documentation | Examples | NPM | Awai-React |


## About

This library introduces a fresh approach to state management, where every event is a thennable (promise-like) with no terminal state.

Awai provides variety of tools helping with organizing asynchronous logic, handling race conditions, and prioritizes the extraction of business logic from the UI layer.

## Installation

```sh
npm install awai
```

## Documentation

- [Quick start](https://awai.js.org/quick-start)
- [Architecture](https://awai.js.org/architecture)
- [Examples](https://awai.js.org/examples)
- Tools:
- [State](https://awai.js.org/state) - simple node which stores data
- [AsyncState](https://awai.js.org/async-state) - helps with storing data loaded asynchronously protecting against race conditions
- [Selector](https://awai.js.org/selector) - combines multiple states into a single value. Handles async loading and protects against race conditions
- [Action](https://awai.js.org/action) - function wrapper which emits events; is helpful for controlling scenarios
- [Scenario](https://awai.js.org/scenario) - composable event listener which allows to declaratively write logic in a saga-like way using async functions
- [FamilyState](https://awai.js.org/family-state) - aggregator of multiple states of the same type; handles both sync and async states
- [Effect](https://awai.js.org/effect) - runs callback on dependency states change and cleans up previous effects
- Other
- [AwaiEvent](https://awai.js.org/awai-event)
- [Registry](https://awai.js.org/registry)
- [Motivation](https://awai.js.org/motivation)

## Integrations

- **React** - [NPM](https://www.npmjs.com/package/awai-react), [GitHub](https://github.com/yuriyyakym/awai-react)