UNPKG

@startpage/local-storage

Version:

Local storage management for your startpage

9 lines (8 loc) 430 B
import React from "react"; type StorageState<ValueType> = [ValueType, (value: ValueType) => void]; export declare const createStorageContext: <ValueType extends unknown>(key: string, initialValue: ValueType) => { StorageConsumer: React.Consumer<StorageState<ValueType>>; StorageProvider: ({ children }: React.PropsWithChildren<unknown>) => JSX.Element; useStorage: () => StorageState<ValueType>; }; export {};