Closed aolney closed 5 years ago
I don't quite follow; there's literally a comment telling you where it's ready! You know it's ready because that callback is called w/o an error:
configureBrowserFS: function() {
fetch('brill.zip').then(function(response) {
return response.arrayBuffer();
}).then(function(zipData) {
var Buffer = BrowserFS.BFSRequire('buffer').Buffer;
BrowserFS.configure({
fs: "ZipFS",
options: {
zipData: Buffer.from(zipData)
}
}, function(e) {
if (e) {
// An error occurred.
throw e;
}
// Otherwise, BrowserFS is ready to use! <-- right here, it's ready here.
});
});
}
If I configure and then immediately list files, I get what appears to be the same error as if I hadn't configured at all. However, if I trigger the file listing using UI (so giving plenty of time for the configuration to happen) there is no error.
This raises the question of how to know when
browserfs
is "ready"Code to configure:
Code to list files: