This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Async await func | |
async function getTimelineData() { | |
var response = await fetch('/some-api-url') | |
return response.json() | |
} | |
async function populateTimelineInit() { | |
var data = await getTimelineData(); | |
new vis.DataSet(data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// We allocate a file with the size of the downloaded file so we can | |
// append chunks randomly to diffrent position as we download the file | |
function allocateDisk(size, callback){ | |
fss.cwd.getFile(prompt("Filename","movie.mp4"), {create: true}, (fileEntry) => { | |
fileEntry.createWriter((writer) => { | |
var blob = new Blob([new ArrayBuffer(1.049e+8)]) | |
writer.onerror = (err) => { |