Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 491 Bytes

File metadata and controls

29 lines (21 loc) · 491 Bytes
title
usePullDownRefreshing

监听用户下拉刷新事件, 回调完成后自动收起.

下拉效果默认停留最短 300ms, 防止收起过快让用户以为下拉不到位.

:::caution 小心 回调函数中的异常会被抛出 :::

用法

import { usePullDownRefreshing } from '@tarojsx/hooks'

const Demo = ({ id }) => {
    usePullDownRefreshing(async () => {
        await refresh()
    })
}

参考

usePullDownRefreshing(fn, delay?: number)