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
HttpParams fromObject should accept ReadonlyArray<string> #28452
Comments
Hi @jinder. How about without second array, just by casting types:
I can create PR with that change, because it shouldn't be that hard to implement, but I'm not sure if it's needed. |
@alan-mroczek I think it's poor practice to cast a immutable type to a mutable one (and preferable to slice it if need be). Angular's API surface should really use immutable types where possible (i.e. where it is not mutating them), as they are subset of the mutable version. |
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. |
🚀 feature request
Relevant Package
@angular/common/http
Description
The type definition for HttpParamsOptions fromObject property only accepts string and string[]. If using immutable types, such as ReadonlyArray, you must create a new array unnecessarily to satisfy the type.
Describe the solution you'd like
Please change the type to the following (which is backwards compatible):
The text was updated successfully, but these errors were encountered: