mirror of
https://github.com/notion-enhancer/notion-enhancer.git
synced 2025-04-06 21:49:03 +00:00
_.mjs -> index.mjs, fix storage callback doc
This commit is contained in:
parent
19c2da54c3
commit
80a4b66128
6
extension/env/storage.mjs
vendored
6
extension/env/storage.mjs
vendored
@ -68,7 +68,7 @@ export const set = (path, value) => {
|
|||||||
}
|
}
|
||||||
chrome.storage.local.set({ [namespace]: values[namespace] }, () => {
|
chrome.storage.local.set({ [namespace]: values[namespace] }, () => {
|
||||||
_onChangeListeners.forEach((listener) =>
|
_onChangeListeners.forEach((listener) =>
|
||||||
listener({ type: 'set', path: pathClone, new: value, old })
|
listener({ path: pathClone, new: value, old })
|
||||||
);
|
);
|
||||||
res(value);
|
res(value);
|
||||||
});
|
});
|
||||||
@ -113,9 +113,7 @@ export const removeChangeListener = (callback) => {
|
|||||||
/**
|
/**
|
||||||
* @callback onStorageChangeCallback
|
* @callback onStorageChangeCallback
|
||||||
* @param {object} event
|
* @param {object} event
|
||||||
* @param {string} event.type - 'set' or 'reset'
|
* @param {string} event.path- the path of keys to the changed value
|
||||||
* @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.new] - the new value being persisted to the store
|
* @param {string} [event.new] - the new value being persisted to the store
|
||||||
* @param {string} [event.old] - the previous value associated with the key
|
* @param {string} [event.old] - the previous value associated with the key
|
||||||
*/
|
*/
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
signedIn = localStorage['LRU:KeyValueStore2:current-user-id'];
|
signedIn = localStorage['LRU:KeyValueStore2:current-user-id'];
|
||||||
|
|
||||||
if (site || page || (whitelisted && signedIn)) {
|
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;
|
{ fs, registry, web } = api;
|
||||||
|
|
||||||
for (const mod of await registry.list((mod) => registry.enabled(mod.id))) {
|
for (const mod of await registry.list((mod) => registry.enabled(mod.id))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user