var PUB_TOKEN = "pk_a3b8e89dc25140098066fdfbee19352b"; var IEX_URL = "https://cloud-sse.iexapis.com/beta/last?symbols=jpm,gs,bac&token=" + PUB_TOKEN; window.addEventListener("WebComponentsReady", function() { // Get element from the DOM. var elem = document.getElementsByTagName("perspective-viewer")[0]; // Add more rows every 50ms using the `update()` method on the `table` directly. var source = new EventSource(IEX_URL); var data = [] source.onmessage = function(event) { for(let ev of JSON.parse(event.data)){ data.push(ev); } elem.update(data); data = []; }; });