State management library
npm install awaiThis 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.
``sh``
npm install awai
- 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
- AwaiEvent
- Registry
- Motivation