-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Collection constructor should allow to set initial values #6319
Copy link
Copy link
Closed
ckeditor/ckeditor5-utils
#326Labels
domain:dxThis issue reports a developer experience problem or possible improvement.This issue reports a developer experience problem or possible improvement.package:utilstype:improvementThis issue reports a possible enhancement of an existing feature.This issue reports a possible enhancement of an existing feature.
Milestone
Metadata
Metadata
Assignees
Labels
domain:dxThis issue reports a developer experience problem or possible improvement.This issue reports a developer experience problem or possible improvement.package:utilstype:improvementThis issue reports a possible enhancement of an existing feature.This issue reports a possible enhancement of an existing feature.
📝 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.If you'd like to see this improvement implemented, add a 👍 reaction to this post.