mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Persist local-storage in external json-file (#2279)
This commit is contained in:
1 parent
da5a4bbdf4
commit
aedcc6d70e
32 files changed
+1025
-618
No files matched your search
@@ -1,7 +1,8 @@
|
||||
import { useState } from "react";
|
||||
import { createStorage, IStorageHelperOptions } from "../utils";
|
||||
import { createStorage } from "../utils";
|
||||
import { CreateObservableOptions } from "mobx/lib/api/observable";
|
||||
|
||||
export function useStorage<T>(key: string, initialValue?: T, options?: IStorageHelperOptions) {
|
||||
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