feat(forms): improve types for AbstractControl#status - #18442
Conversation
There was a problem hiding this comment.
TS throws here if we don't do this silly cast.
It appears there is some issue where we can't assign EventEmitter<T> to Observable<T>
|
Consider refactoring to a type: export type AbstractControlStatus = 'VALID'|'INVALID'|'PENDING'|'DISABLED';Swap out inline usage with the newly-defined type. |
|
The issue with that is it'll be yet another export, weather it's public or not I'm unsure but either way cutting down on exports is always good |
|
OK. So, keep the |
f0502dd to
5619ce8
Compare
|
Merging this would help our team maintaining a clean coding style 馃憤 |
79cd803 to
572d1d2
Compare
572d1d2 to
15b0065
Compare
|
Hi @Toxicable! This PR has merge conflicts due to recent upstream merges. |
|
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. |
PR Checklist
PR Type
What is the current behavior?
AbstractControl#statusis currently typed to string where as it has four distinct cases of it's valueWhat is the new behavior?
AbstractControl#statusnow is of type'VALID' | 'INVALID' | 'PENDING' | 'DISABLED'giving slightly better support for the developerDoes this PR introduce a breaking change?
If someone is comparing
AbstractControl#statusto a string other than the ones it will be typed to then after this change TS will throw an error at compile timeDuplicate of #16841 - since I couldn't fix circle ci validating old commits messages