UNPKG

next-easy-keepalive

Version:

It is an easy-to-use keepAlive library exclusively for nextjs.

11 lines (10 loc) 537 B
import React from 'react'; import { KeepAliveHookOptions } from '../../types'; export declare const useKeepAlive: (key: string, option?: KeepAliveHookOptions | undefined) => { isBack: boolean; useNotBackEffect: (func: Function, deps?: any[]) => void; useBackActive: (func: Function, deps?: any[]) => void; useMemState: <S>(state: S, keyName: string) => [S, React.Dispatch<React.SetStateAction<S>>]; useMemRef: <S_1>(ref: S_1, keyName: string) => React.MutableRefObject<S_1>; }; export default useKeepAlive;