@sohanemon/utils 4.0.4 → 4.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,5 +8,5 @@ export declare const useIsomorphicEffect: any;
8
8
  export declare function useTimeout(callback: () => void, delay?: number | null): void;
9
9
  export declare function useWindowEvent<K extends string = keyof WindowEventMap>(type: K, listener: K extends keyof WindowEventMap ? (this: Window, ev: WindowEventMap[K]) => void : (this: Window, ev: CustomEvent) => void, options?: boolean | AddEventListenerOptions): void;
10
10
  type LocalStorageValue<T> = [T, Dispatch<SetStateAction<T>>];
11
- declare const useLocalStorage: <T extends Record<string, any>>(key: string, defaultValue: T) => LocalStorageValue<T>;
12
- export default useLocalStorage;
11
+ export declare const useLocalStorage: <T extends Record<string, any>>(key: string, defaultValue: T) => LocalStorageValue<T>;
12
+ export {};
@@ -102,7 +102,7 @@ export function useWindowEvent(type, listener, options) {
102
102
  }, [type, listener]);
103
103
  }
104
104
  // Custom hook for using local storage with a specified key and default value
105
- const useLocalStorage = (key, defaultValue) => {
105
+ export const useLocalStorage = (key, defaultValue) => {
106
106
  const [storedValue, setStoredValue] = useState(defaultValue);
107
107
  // Use effect to retrieve the stored value from local storage on component mount
108
108
  useEffect(() => {
@@ -126,4 +126,3 @@ const useLocalStorage = (key, defaultValue) => {
126
126
  };
127
127
  return [storedValue, updateStoredValue];
128
128
  };
129
- export default useLocalStorage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sohanemon/utils",
3
- "version": "4.0.4",
3
+ "version": "4.0.5",
4
4
  "description": "",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./dist/index.js",