diff --git a/docs/src/content/docs/utilities/filter-array.md b/docs/src/content/docs/utilities/filter-array.md index db050d08..8629e901 100644 --- a/docs/src/content/docs/utilities/filter-array.md +++ b/docs/src/content/docs/utilities/filter-array.md @@ -3,18 +3,18 @@ title: filterArray description: ngxtension/filter-array --- -`filterArray` is a RxJs Helper function used when you need to execute a filtering function on an array. +`filterArray` is an RxJS helper function designed for applying a filtering function to an array. The following code: ```ts -const myObs = of([1, 2, 3]); -const myResultObs = myObs.pipe(map((arr) => arr.filter((e) => e <= 2))); +const source$ = of([1, 2, 3]); +const filtered$ = source$.pipe(map((arr) => arr.filter((element) => element <= 2))); ``` -becomes +can be simplified to: ```ts -const myObs = of([1, 2, 3]); -const myResultObs = myObs.pipe(fitlerArray((e) => e <= 1)); +const source$ = of([1, 2, 3]); +const filtered$ = source$.pipe(filterArray((element) => element <= 2)); ``` diff --git a/docs/src/content/docs/utilities/filter-nil.md b/docs/src/content/docs/utilities/filter-nil.md index ee9f33f2..e66880cf 100644 --- a/docs/src/content/docs/utilities/filter-nil.md +++ b/docs/src/content/docs/utilities/filter-nil.md @@ -3,20 +3,22 @@ title: filterNil description: ngxtension/filter-nil --- -`filterNil` is a RxJs Helper function used to filter `undefined` and `null` value inside an observable. This operator return a strongly typed value without `undefined` and `null` Type. +`filterNil` is an RxJS helper function designed to filter out `undefined` and `null` values from an observable. This operator returns a strongly-typed value, excluding `undefined` and `null`. The following code: ```ts -const myObs = of(undefined, null, 1, undefined); -const myResultObs = myObs.pipe(filter(e => e !== undefined && e !== null)); - ^? number | undefined | null +const source$ = of(undefined, null, 1, undefined); +const filtered$ = source$.pipe(filter((e) => e !== undefined && e !== null)); +// Output: 1 +// Type: Observable ``` -becomes +can be simplified to: ```ts -const myObs = of(undefined, null, 1, undefined); -const myResultObs = myObs.pipe(filterNil()); - ^? number +const source$ = of(undefined, null, 1, undefined); +const filtered$ = source$.pipe(filterNil()); +// Output: 1 +// Type: Observable ``` diff --git a/docs/src/content/docs/utilities/map-array.md b/docs/src/content/docs/utilities/map-array.md index be9689de..966a8b39 100644 --- a/docs/src/content/docs/utilities/map-array.md +++ b/docs/src/content/docs/utilities/map-array.md @@ -3,7 +3,7 @@ title: mapArray description: ngxtension/map-array --- -`mapArray` is a RxJs Helper function used when you need to execute a mapping function to map each element of an array. +`mapArray` is an RxJs Helper function designed for applying a transform/map function to an array. The following code: @@ -12,7 +12,7 @@ const myObs = of([1, 2, 3]); const myResultObs = myObs.pipe(map((arr) => arr.map((e) => e + 1))); ``` -becomes +can be simplified to: ```ts const myObs = of([1, 2, 3]);