Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync subscription TS defintions with Flow
- Loading branch information
1 parent
7d9ad14
commit 49f86be
Showing
4 changed files
with
36 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* Given an error, returns an AsyncIterable which will fail with that error. | ||
* | ||
* Similar to Promise.reject(error) | ||
*/ | ||
export default function asyncIteratorReject(error: Error): AsyncIterator<void>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
export { subscribe, createSourceEventStream } from './subscribe'; | ||
export { | ||
subscribe, | ||
createSourceEventStream, | ||
SubscriptionArgs, | ||
} from './subscribe'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* Given an AsyncIterable and a callback function, return an AsyncIterator | ||
* which produces values mapped via calling the callback function. | ||
*/ | ||
export default function mapAsyncIterator<T, U>( | ||
iterable: AsyncIterable<T>, | ||
callback: (arg: T) => PromiseOrValue<U>, | ||
rejectCallback?: (arg: any) => PromiseOrValue<U>, | ||
): AsyncGenerator<U, void, void>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters