Skip to content
This repository has been archived by the owner on Feb 6, 2019. It is now read-only.

Iterators #233

Open
JonKrone opened this issue Mar 20, 2016 · 0 comments
Open

Iterators #233

JonKrone opened this issue Mar 20, 2016 · 0 comments

Comments

@JonKrone
Copy link
Collaborator

Could thunks be turned into generators?

  • augment thunk middleware to notice and handle iterators
interface Iterator {
    next(value) : IteratorResult;
    [optional] throw(value) : IteratorResult;
    [optional] return(value) : IteratorResult;
}

interface IteratorResult {
    value : any;
    done : bool;
}
interface AsyncIterator {
    next(value) : Promise<IteratorResult>;
    [optional] throw(value) : Promise<IteratorResult>;
    [optional] return(value) : Promise<IteratorResult>;
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant