You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The original example for Promise.all and await can not work functionally together (see MDN for details.).
A new example can be adopted as:
asyncfunctionfetchSQL(){const[SQL,buf]=awaitPromise.all([initSqlJs({locateFile: file=>`https://path/to/your/dist/folder/dist/${file}`}),fetch("/path/to/database.sqlite").then(res=>res.arrayBuffer())]);constdb=newSQL.Database(newUint8Array(buf));// other command as below}fetchSQL();
The text was updated successfully, but these errors were encountered:
Oh, I get what you are saying. It seemed evident to me that the given example had to be run in an async context (which is now supported at the root level in many places, including node). If you want to add a note to specify that (without changing the code snippet), I'll accept a pull request :)
The original example for
Promise.all
andawait
can not work functionally together (see MDN for details.).A new example can be adopted as:
The text was updated successfully, but these errors were encountered: