mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix StorageHelper.get() returning null after clearing (#2421)
This commit is contained in:
1 parent
da196387b8
commit
04e5180511
6 files changed
+11
-21
No files matched your search
@@ -2,7 +2,7 @@ import { useState } from "react";
|
||||
import { createStorage } from "../utils";
|
||||
import { CreateObservableOptions } from "mobx/lib/api/observable";
|
||||
|
||||
export function useStorage<T>(key: string, initialValue?: T, options?: CreateObservableOptions) {
|
||||
export function useStorage<T>(key: string, initialValue: T, options?: CreateObservableOptions) {
|
||||
const storage = createStorage(key, initialValue, options);
|
||||
const [storageValue, setStorageValue] = useState(storage.get());
|
||||
const setValue = (value: T) => {
|
||||
|
||||
Reference in new issue
Block a user