Skip to content

Commit

Permalink
Merge pull request #186 from zyxkad/dev2
Browse files Browse the repository at this point in the history
bumb MCLA to v0.4.23
  • Loading branch information
zyxkad authored Jan 17, 2024
2 parents 537b73d + e181b8b commit 9c1bafe
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/.vitepress/analyzers/mcla.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export {
loadMCLA,
}

const VERSION = "v0.4.22"
const VERSION = "v0.4.23"
// const VERSION = "dev"
const RESOURCES_BASE = "https://globemc.github.io/mcla"
const GO_WASM_EXEC_URL = useCDN(`${RESOURCES_BASE}/${VERSION}/wasm_exec.js`)
Expand Down
23 changes: 23 additions & 0 deletions docs/public/scripts/mcla_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,29 @@ class DBStorage {
return this._getStore().index("k")
}

_openCursor() {
return this._getStore().openCursor()
}

keys() {
return new Promise((resolve, reject) => {
const keys = []
const request = this._openCursor()
request.onerror = reject
request.onsuccess = function(event) {
const cursor = event.target.result
if (cursor) {
const key = cursor.primaryKey
console.debug(key, cursor.value)
keys.push(key)
cursor.continue()
} else {
resolve(keys)
}
};
})
}

async getItem(key) {
const res = (await wrapDBReq(this._getIndex().get(key))).target.result
if (res) {
Expand Down

0 comments on commit 9c1bafe

Please sign in to comment.