diff --git a/docs/reference/api/rxjs.md b/docs/reference/api/rxjs.md index a0ed0db..3617c36 100644 --- a/docs/reference/api/rxjs.md +++ b/docs/reference/api/rxjs.md @@ -160,21 +160,21 @@ test$.subscribe((result) => { #### filterResultErr -Converts an `Observable>` to an `Observble` by filtering out the Oks and mapping to the error values. +Converts an `Observable>` to an `Observable` by filtering out the Oks and mapping to the error values. ```typescript import { of, Observable } from 'rxjs'; import { Ok, Err, Result } from 'ts-results-es'; -import { filterResultOk } from 'ts-results-es/rxjs-operators'; +import { filterResultErr } from 'ts-results-es/rxjs-operators'; const obs$: Observable> = of(new Ok(5), new Err(new Error('uh oh'))); -const test$ = obs$.pipe(filterResultOk()); // Has type Observable +const test$ = obs$.pipe(filterResultErr()); // Has type Observable test$.subscribe((result) => { - console.log('Got number: ' + result); + console.log('Got error: ' + result); }); // Logs the following: -// Got number: 5 +// Got error: uh oh ``` diff --git a/docs/reference/api/rxjs.rst b/docs/reference/api/rxjs.rst index 010946d..3db66a4 100644 --- a/docs/reference/api/rxjs.rst +++ b/docs/reference/api/rxjs.rst @@ -183,25 +183,25 @@ filtering out the Errs and mapping to the Ok values. ``filterResultErr()`` --------------------- -Converts an ``Observable>`` to an ``Observble`` by +Converts an ``Observable>`` to an ``Observble`` by filtering out the Oks and mapping to the error values. .. code:: typescript import { of, Observable } from 'rxjs'; import { Ok, Err, Result } from 'ts-results-es'; - import { filterResultOk } from 'ts-results-es/rxjs-operators'; + import { filterResultErr } from 'ts-results-es/rxjs-operators'; const obs$: Observable> = of(new Ok(5), new Err(new Error('uh oh'))); - const test$ = obs$.pipe(filterResultOk()); // Has type Observable + const test$ = obs$.pipe(filterResultErr()); // Has type Observable test$.subscribe((result) => { - console.log('Got number: ' + result); + console.log('Got error: ' + result); }); // Logs the following: - // Got number: 5 + // Got error: uh oh .. _Reactive Extensions for JavaScript: https://rxjs.dev/