Skip to content

Commit

Permalink
Fix example for bindCallback (#7178)
Browse files Browse the repository at this point in the history
The example, as it was, crashes with `Error: cb is not a function` on line 5.
  • Loading branch information
ondrasej authored and benlesh committed Feb 17, 2023
1 parent 29d9ca5 commit 3c4b2ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/internal/observable/bindCallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ export function bindCallback<A extends readonly unknown[], R extends readonly un
* ```ts
* import { bindCallback } from 'rxjs';
*
* const someFunction = (cb) => {
* cb(5, 'some string', {someProperty: 'someValue'})
* const someFunction = (n, s, cb) => {
* cb(n, s, { someProperty: 'someValue' });
* };
*
* const boundSomeFunction = bindCallback(someFunction);
* boundSomeFunction(12, 10).subscribe(values => {
* console.log(values); // [22, 2]
* boundSomeFunction(5, 'some string').subscribe((values) => {
* console.log(values); // [5, 'some string', {someProperty: 'someValue'}]
* });
* ```
*
Expand Down

0 comments on commit 3c4b2ca

Please sign in to comment.