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
Bugfix/fix return type for get method #197
Bugfix/fix return type for get method #197
Conversation
I fount a couple of more typing issues. See safe-pluck here: https://github.com/BioPhoton/rx-angular/blob/fix-return-type-for-get-method/libs/state/src/lib/core/utils/safe-pluck.ts |
if it's not relevant with this issue please open separate issue and I will handle it on another PR |
I @JakubDospial as suggested please take the propper implementation from https://github.com/BioPhoton/rx-angular/tree/fix-return-type-for-get-method. Also please reuse the safePluck in distinctUntilSomeChanged.ts |
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.
thanks for your great work!
I have adjusted the behavior of safePluck to fit the null
undefined
conventions of our other internals.
The reason why safePluck
is safe is that it raises no error when a corrupt input comes by. This was the most frustrating thing when using the old pluck
pipe. You always had to check for null and undefined before you could safely use it.
Co-authored-by: Julian Jandl <hoebbelsb@gmail.com>
Co-authored-by: Julian Jandl <hoebbelsb@gmail.com>
Co-authored-by: Julian Jandl <hoebbelsb@gmail.com>
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.
hey jakub, together with @Karnaukhov-kh I was reviewing your PR again. We maybe plan to move the safePluck method inside the transformation-helpers. That's why we wanted to make sure it really behaves like all our other internals. When you are fine with those suggestions, please commit them 👍
Co-authored-by: Julian Jandl <hoebbelsb@gmail.com>
Co-authored-by: Julian Jandl <hoebbelsb@gmail.com>
Co-authored-by: Julian Jandl <hoebbelsb@gmail.com>
Co-authored-by: Julian Jandl <hoebbelsb@gmail.com>
Is this ready for merge? |
Merge Biophoton master to my master
@@ -14,6 +14,7 @@ describe('safePluck', () => { | |||
|
|||
it('should return value of last key', () => { | |||
expect(safePluck(obj, ['foo', 'bar'])).toEqual(bar); | |||
expect(safePluck(obj, 'foo')).toEqual(obj.foo); |
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.
ty :)
@BioPhoton yes from my point of view! |
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.
thanks!
references this issue: #193