Skip to content

Commit

Permalink
add an example to fromCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
andogq committed May 7, 2024
1 parent 3ce4ff3 commit 7fe9df1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/stream/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ export class StreamBase {
* The first parameter provided to the callback (the `error`) will be emitted as an `Error`
* atom, whilst the second parameter (the `value`) will be emitted as an `Ok` atom.
*
* @example
* $.fromCallback((next) => someAsyncMethod(paramA, paramB, next));
*
* @group Creation
*/
static fromCallback<T, E>(cb: (next: (error: E, value: T) => unknown) => void): Stream<T, E> {
Expand Down

0 comments on commit 7fe9df1

Please sign in to comment.