Skip to content

Instantly share code, notes, and snippets.

@takkkun
Created September 24, 2014 18:15
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 takkkun/8d820c4d5bce4e712e70 to your computer and use it in GitHub Desktop.
Save takkkun/8d820c4d5bce4e712e70 to your computer and use it in GitHub Desktop.
require(['file-chunk'], function(FileChunk) {
var file = pickupFile();
var fileChunk = new FileChunk(file);
var chunks = fileChunk.chop(4096);
// each: 各チャンクのpromiseのdoneを設定する
chunks.each(function(chunk) {
});
// done: 各チャンクのpromiseを$.whenでまとめたpromiseのdoneを設定する
chunks.done(function() {
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment