@sendbird/uikit-react
Version:
Sendbird UIKit for React: A feature-rich and customizable chat UI kit with messaging, channel management, and user authentication.
15 lines (14 loc) • 470 B
TypeScript
/// <reference types="react" />
import { type Store } from '../utils/storeManager';
type StoreSelector<T, U> = (state: T) => U;
/**
* A generic hook for accessing and updating store state
* @param StoreContext
* @param selector
* @param initialState
*/
export declare function useStore<T, U>(StoreContext: React.Context<Store<T> | null>, selector: StoreSelector<T, U>, initialState: T): {
state: U;
updateState: (updates: Partial<T>) => void;
};
export {};