Skip to content

yuriyyakym/awai

Repository files navigation

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

npm install awai

Documentation

  • Quick start
  • Architecture
  • Examples
  • Tools:
    • State - simple node which stores data
    • AsyncState - helps with storing data loaded asynchronously protecting against race conditions
    • Selector - combines multiple states into a single value. Handles async loading and protects against race conditions
    • Action - function wrapper which emits events; is helpful for controlling scenarios
    • Scenario - composable event listener which allows to declaratively write logic in a saga-like way using async functions
    • FamilyState - aggregator of multiple states of the same type; handles both sync and async states
    • Effect - runs callback on dependency states change and cleans up previous effects
  • Other

Integrations

About

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

Topics

Resources

License

Stars

Watchers

Forks