Skip to content

Collection constructor should allow to set initial values #6319

@mlewand

Description

@mlewand

📝 Provide a description of the improvement

Currently the only way to set collection value is to keep calling .add() for each value.

It should be possible to initialize it with an iterable object. That's both convenient and sometimes more efficient in terms of performance.

There's also a similar ticket asking to allow adding multiple values using .add() at once #4992.

📃 Other details

Required by #6194.

There's a nice PR that adds this together with the add() function which I'll base upon for solution to this issue - stripping stuff that is not needed for this fix.

  • Browser: Any
  • OS: Any

If you'd like to see this improvement implemented, add a 👍 reaction to this post.

Metadata

Metadata

Assignees

Labels

domain:dxThis issue reports a developer experience problem or possible improvement.package:utilstype:improvementThis issue reports a possible enhancement of an existing feature.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions