mirror of
https://github.com/go-gitea/gitea.git
synced 2026-01-24 02:09:33 +01:00
remove return value, not yet needed
This commit is contained in:
parent
f10ab8d9b0
commit
f30f4a002e
@ -10,11 +10,9 @@ export function setLocalStorageSetting(key: string, value: string) {
|
||||
|
||||
/** Add a listener to the 'storage' event for given setting key. This event only fires in non-current tabs. */
|
||||
export function addLocalStorageChangeListener(key: string, listener: (e: StorageEvent) => void) {
|
||||
const fn = (e: StorageEvent) => {
|
||||
window.addEventListener('storage', (e: StorageEvent) => {
|
||||
if (e.storageArea === localStorage && e.key === key) {
|
||||
listener(e);
|
||||
}
|
||||
};
|
||||
window.addEventListener('storage', fn);
|
||||
return fn; // for unregister
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user