awai icon indicating copy to clipboard operation
awai copied to clipboard

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

Results 9 awai issues
Sort by recently updated
recently updated
newest added

- [ ] DevHunt - [x] HN - [x] LinkedIn blog post - [ ] StackOverflow article - [x] Dev.to post - [x] GitHub Discussions

help wanted

Update config of AsyncState and AsyncSelector with `{ lazy?: boolean }` config prop, so that their initializing predicate is not run until state is read.

enhancement

Right now asyncSelector is used if either any of dependencies is async readable, or if predicate's constructor is `AsyncFunction`. ```ts const isAsyncPredicate = predicate.constructor.name === 'AsyncFunction'; ``` [Source](https://github.com/yuriyyakym/awai/blob/master/src/selector/selector.ts#L13) ### Current...

bug

Add utils tests and reach 100% coverage

tests

Right now the only way to trigger a scenario with multiple AwaiEvents's/promises is to have a trigger callback and use Promise.race, like so: ```ts scenario( () => Promise.race([ action1.events.invoked, delay(1000),...

enhancement
idea

It may handle `action` and readable states. Current approach: ```ts const items = state(); const createItem = action(); scenario(items.events.changed, () => { /* ... */ }); scenario(createItem.events.invoked, () => {...

enhancement
idea