jeudi 16 février 2017

What methods or patterns can be used for rendering UI components based on supplied array?

I'm currently playing about with node.js and am looking to find a neater method for rendering a list based on an array returned to the client through an event.

In my sample application, the node server emits a 'details-changed' event which passes a simple array. At the UI end, I consume that event and render a list item for each of the array elements.

At present, I am deleting all list items and recreating them all based on the returned array. However, I would like to know if there is a more efficient method or pattern where existing items remain and only new items created and missing items removed.

Aucun commentaire:

Enregistrer un commentaire