-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(rxjs): create a set of rxjs operators #66
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution. A couple of nits
@@ -0,0 +1,22 @@ | |||
--- | |||
title: filter nil RxJs operator | |||
description: ngxtension/filter-array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: wrong description>?
import { map, pipe } from 'rxjs'; | ||
|
||
export const filterArray = <T>(filterFn: (item: T) => boolean) => { | ||
return pipe(map((array: T[]) => array.filter((item) => filterFn(item)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: I'm pretty sure pipe()
isn't needed.
import { filter, pipe } from 'rxjs'; | ||
|
||
export const filterNil = <T>() => | ||
pipe( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: pipe()
isn't needed
import { map, pipe } from 'rxjs'; | ||
|
||
export const mapArray = <T, R>(mapFn: (item: T) => R) => { | ||
return pipe(map((array: T[]) => array.map((item) => mapFn(item)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: pipe()
isn't needed
libs/ngxtension/project.json
Outdated
"libs/ngxtension/filter-array/**/*.ts", | ||
"libs/ngxtension/filter-array/**/*.html", | ||
"libs/ngxtension/filter-nil/**/*.ts", | ||
"libs/ngxtension/filter-nil/**/*.html" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment: remove these
@all-contributors please add @tomalaforge for code |
I've put up a pull request to add @tomalaforge! 🎉 |
☁️ Nx Cloud ReportCI is running/has finished running commands for commit a074b12. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 4 targetsSent with 💌 from NxCloud. |
b70a190
to
a074b12
Compare
thanks @nartc for reviewing my PR. Changes made |
closing issue #41