npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-ruitao-refresh

v1.0.1

Published

pull to refresh and pull to loadmore

Downloads

5

Readme

介绍

这是一个针对Android的listview的一个下拉刷新和上拉加载的组件, 后续会增加ios版本

功能介绍

使用

  • npm i react-native-ruitao-refresh --save
import Refresh from 'react-native-ruitao-refresh'

...

_onRefresh(callback){
    // 这里去刷新数据, 刷新成功后去执行callback
    callback()
}

_onLoadMore(callback){
    // 这里去加载数据, 加载完成后执行callback
    callback()
}

render(){
    return (
        <View style={{flex:1}}>
            <Refresh 
            pullHeight={50}
            loadMoreHeight={50}
            autoLoadMore={false}
            dataSource={this.state.dataSource}
            onRefresh={this._onRefresh.bind(this)}
            onLoadMore={this._onLoadMore.bind(this)}
            renderRow={(item) => (
                <View style={{height:50,borderWidth:1,borderColor:'#f00'}}>
                    <Text>{item}</Text>
                </View>
            )}
            />
        </View>
    )
}

下拉刷新

属性

  • pullHeight: 下拉高度,默认:80
  • onRefresh(callback): 刷新函数, 此函数有个回调, 当执行回调的时候就说明刷新结束
  • statusTextObj : 对应下拉的每个状态的显示文本,自定义

上拉加载

属性

  • loadMoreHeight: 上拉高度,默认:80
  • autoLoadMore: 默认: false, 是否自动加载(不需要上拉就去加载),如果开始则意味着上拉失效
  • onLoadMore(callback): 如果没有该属性则不会去loadmore, 当callback()被执行的时候则说明loadmore结束, 当执行callback(true), 说明全部数据已经加载完毕
  • loadMoreStatusTextObj: 对应上拉的每个状态文本值, 用户可以自定义

完全支持ListView的属性

  • 因为就是ListView

欢迎大家提 issues