@telegram-apps/sdk-react
Version:
React bindings for Mini Apps client SDK. Contains hooks, components and other useful tools which allow usage of React along with Mini Apps client SDK.
11 lines (10 loc) • 465 B
TypeScript
/**
* Returns the underlying signal value updating it each time the signal value changes.
* @param signal - a signal.
* @param getServerSnapshot - an optional function returning the signal value snapshot. It is used only during SSR
* to provide an initial value of the signal. When not set, defaults to the signal itself.
*/
export declare function useSignal<T>(signal: {
(): T;
sub(fn: VoidFunction): VoidFunction;
}, getServerSnapshot?: () => T): T;