Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tomlagier
Created June 24, 2017 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomlagier/0ea09b600ec912e0e147c36d36b93854 to your computer and use it in GitHub Desktop.
Save tomlagier/0ea09b600ec912e0e147c36d36b93854 to your computer and use it in GitHub Desktop.
const fr = new FileReader();
fr.readAsArrayBuffer(file);
fr.onloadend = heap => this.worker.postMessage({
command: 'TransferProfile',
data: {
heap
}
}, [heap]); //Passing [heap] as a 2nd parameter flags it as Transferable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment