message: feat(local-storage): emit 'local-storage' on update
diff: @@ -9,7 +9,12 @@ function getItem(key: string): string {
  function setItem(key: string, value: string): string {
  try {
  + if (localStorage.getItem(key) === value) {
  + return value;
  + }
  +
  localStorage.setItem(key, value);
  + notify(key, value);
  return value;
  } catch (error) {
  console.warn(`Unable to set key "${key}" of localStorage:`, error);
  @@ -17,6 +22,13 @@ function setItem(key: string, value: string): string {
  }
  }
  +function notify(key: string, value: string) {
  + if (window && typeof window.dispatchEvent === 'function') {
  + const detail = { key, value };
  + window.dispatchEvent(new CustomEvent('local-storage', { detail }));
  + }
  +}
  +
  type LocalStorageGetter = () => string;
  type LocalStorageSetter = (value: string) => string;
  