function * _sampleIterator(a: number) {
const b = yield new Promise(
r => setTimeout(() => r(a + 1), 1000)
);
const c = yield function * () {
const d = yield b + 1;
yield d + 1;
}
const e = yield () => {
return c + 1
}
return e + 1;
}
const taskInstance = asyncIteratorFactory(_sampleIterator(1));
const result = await taskInstance();
// result = 5
-
Notifications
You must be signed in to change notification settings - Fork 0
srowhani/atask
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Clean and concise abstractions for working with asynchronous code
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published