Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
refreshData(data, clear = false) {
if (!clear) {...} else {...}
data.forEach(datum => {
const element = document.createElement('data-table-row');
element.setAttribute('name', datum.name);
element.setAttribute('id', datum.id);
element.setAttribute('email', datum.email);
this._dataTable.prepend(element);
});
requestAnimationFrame(() => DataApp.emitEvent(this, 'refreshed-data', {
scrollHeight: this._dataTable.scrollHeight
}));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment