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
refactor(core): refactor WrappedValue #20997
Conversation
You can preview af5ad97 at https://pr20997-af5ad97.ngbuilds.io/. |
You can preview 8728965 at https://pr20997-8728965.ngbuilds.io/. |
|
||
reset() { this.hasWrappedValue = false; } | ||
static isWrapped(value: any): boolean { return value instanceof WrappedValue; } |
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.
Consider changing the return type to value is WrappedValue
and then changing unwrap
to us it.
You can preview 33dc163 at https://pr20997-33dc163.ngbuilds.io/. |
You can preview b508bb4 at https://pr20997-b508bb4.ngbuilds.io/. |
status: |
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.
otherwise lgtm
} | ||
return value; | ||
} | ||
static unwrap(value: any): any { return WrappedValue.isWrapped(value) ? value.wrapped : value; } |
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.
please add docs
also please add better commit message description to explain the motivation behind this change. |
You can preview c662dca at https://pr20997-c662dca.ngbuilds.io/. |
You can preview fb3cae2 at https://pr20997-fb3cae2.ngbuilds.io/. |
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.
Small tweaks requested. Otherwise lgtm.
|
||
reset() { this.hasWrappedValue = false; } | ||
/** Return whether `value` is wrapped */ |
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.
Returns true if value
is wrapped.
} | ||
return value; | ||
} | ||
/** Return the underlying value of a wrapped value. Returns the given `value` when it is not |
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.
Return - > Returns
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.
And can you please move the second sentence on a new line?
*/ | ||
export class ValueUnwrapper { | ||
public hasWrappedValue = false; | ||
/** Creates a wrapped value */ |
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.
Period
715405f
to
bbf24ee
Compare
You can preview 715405f at https://pr20997-715405f.ngbuilds.io/. |
You can preview bbf24ee at https://pr20997-bbf24ee.ngbuilds.io/. |
@@ -44,26 +44,22 @@ export function devModeEqual(a: any, b: any): boolean { | |||
* @stable | |||
*/ | |||
export class WrappedValue { | |||
constructor(public wrapped: any) {} | |||
/** @deprecated from 6.0, use `unwrap()` instead - will switch to protected */ |
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.
This should be 5.2
@vicb you said that this commit doesn't need a better description, yet you created an awesome description for the PR. I think the same info that's in the PR description would be useful to anyone looking at the commit via In general we should care more about the commit messages than PR descriptions because we rarely go back to look at the old PRs but we more commonly look at individual commits when doing git log or doing release review. thanks! |
- Improve `WrappedValue` by adding `unwrap` symetrical to `wrap`. - remove dead code - `ValueUnwrapper` The property `wrapped` is an implementation details and should never be accessed directly - use `unwrap(wrappedValue)`. Will change to protected in Angular 7.
You can preview 4a9c06c at https://pr20997-4a9c06c.ngbuilds.io/. |
You can preview d1adacc at https://pr20997-d1adacc.ngbuilds.io/. |
- Improve `WrappedValue` by adding `unwrap` symetrical to `wrap`. - remove dead code - `ValueUnwrapper` The property `wrapped` is an implementation details and should never be accessed directly - use `unwrap(wrappedValue)`. Will change to protected in Angular 7. PR Close #20997
- Improve `WrappedValue` by adding `unwrap` symetrical to `wrap`. - remove dead code - `ValueUnwrapper` The property `wrapped` is an implementation details and should never be accessed directly - use `unwrap(wrappedValue)`. Will change to protected in Angular 7. PR Close angular#20997
- Improve `WrappedValue` by adding `unwrap` symetrical to `wrap`. - remove dead code - `ValueUnwrapper` The property `wrapped` is an implementation details and should never be accessed directly - use `unwrap(wrappedValue)`. Will change to protected in Angular 7. PR Close angular#20997
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
WrappedValue
by addingunwrap
symetrical towrap
.ValueUnwrapper
The property
wrapped
is an implementation details and should never be accessed directly - useunwrap(wrappedValue)
. Will change toprotected
in Angular 7.