From 80a4b6612848948c60852fea817657eae677696d Mon Sep 17 00:00:00 2001 From: dragonwocky Date: Tue, 30 Nov 2021 18:12:04 +1100 Subject: [PATCH] _.mjs -> index.mjs, fix storage callback doc --- extension/env/storage.mjs | 6 ++---- extension/init.js | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/extension/env/storage.mjs b/extension/env/storage.mjs index 3003231..f630963 100644 --- a/extension/env/storage.mjs +++ b/extension/env/storage.mjs @@ -68,7 +68,7 @@ export const set = (path, value) => { } chrome.storage.local.set({ [namespace]: values[namespace] }, () => { _onChangeListeners.forEach((listener) => - listener({ type: 'set', path: pathClone, new: value, old }) + listener({ path: pathClone, new: value, old }) ); res(value); }); @@ -113,9 +113,7 @@ export const removeChangeListener = (callback) => { /** * @callback onStorageChangeCallback * @param {object} event - * @param {string} event.type - 'set' or 'reset' - * @param {string} event.namespace- the name of the store, e.g. a mod id - * @param {string} [event.key] - the key associated with the changed value + * @param {string} event.path- the path of keys to the changed value * @param {string} [event.new] - the new value being persisted to the store * @param {string} [event.old] - the previous value associated with the key */ diff --git a/extension/init.js b/extension/init.js index a56037c..e8de939 100644 --- a/extension/init.js +++ b/extension/init.js @@ -13,7 +13,7 @@ signedIn = localStorage['LRU:KeyValueStore2:current-user-id']; if (site || page || (whitelisted && signedIn)) { - const api = await import(chrome.runtime.getURL('api/_.mjs')), + const api = await import(chrome.runtime.getURL('api/index.mjs')), { fs, registry, web } = api; for (const mod of await registry.list((mod) => registry.enabled(mod.id))) {