knockout.merge icon indicating copy to clipboard operation
knockout.merge copied to clipboard

Initialize constructor with data

Open deblocker opened this issue 8 years ago • 5 comments

Hi, maybe i'm missing if there is a way to initialize an observable array with data, at least for performance improvement. Actually, i'm doing that with a patch like this one below

if (knockoutElement.mergeConstructor.length === 1) {
  var arrayElement = new knockoutElement.mergeConstructor(element);
  knockoutElement.push(arrayElement);
}

But i'm asking if there would be a cleaner method... THX in advance, keep up this great work!

deblocker avatar Apr 05 '16 13:04 deblocker