UNPKG

@shared-state/react

Version:

This package provides a series of APIs for using Shared State via React

5 lines (4 loc) 388 B
import { SharedState } from "@shared-state/core"; export declare function useSharedStateValue<T>(sharedState: SharedState<T>): T; export declare function useSetSharedStateValue<T>(sharedState: SharedState<T>): (valueOrUpdater: import("@shared-state/core").ValueOrUpdater<T>) => void; export declare function useSharedState<T>(sharedState: SharedState<T>): [T, SharedState<T>["set"]];