What goes in the updateTarget function of the createMapping() argument with Maquette?

118 views Asked by At

I have an array updating every second and I'm going through the advanced section with mapped arrays, and cannot complete the task. I'm stumped at what goes inside the updateTarget(updatedSource, target) {} function. The comments and codepen's end there, and nothing is ever shown in the dom. The function is clearly getting called, but I don't know how to update a target with a new source.

1

There are 1 answers

0
Johan Gorter On BEST ANSWER

The signature and typical implementation of the updateTarget parameter is as follows:

function updateResult(itemRecord, itemComponent, index) {
  itemComponent.setItemRecord(itemRecord);
}

I have created a complete demonstration of createMapping here.