JsCommunity / JsCommunity/reaclette
[computed] Support async iterators
Open
Nobody has claimed this yet.
enhancement
help wanted
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
const Clock = provideState({
computed: {
// it simply returns an async iterator instead of a value
//
// the computed is undefined before the first
// value is emitted by the iterator
//
// each new emitted value will trigger a new render with the
// computed set to this value
//
// rejections are not handled and will possibly trigger an
// unhandledRejection event on the window object, the computed will
// keep its previous value
//
// this computed, which does not have dependencies, yields a new
// date value every second
async *date() {
while (true) {
yield new Date()
await new Promise(resolve => setTimeout(resolve, 1e3))
}
}
}
})(injectState(({ state }) => <p>{state.date.toISOString()}</p>))
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Start by locating the computed-state implementation; done means async iterators yield values into state, trigger renders, remain undefined before the first yield, and retain the previous value after rejection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100