Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite scroll #22

Open
kof opened this issue Apr 18, 2016 · 11 comments
Open

Infinite scroll #22

kof opened this issue Apr 18, 2016 · 11 comments
Assignees

Comments

@kof
Copy link

kof commented Apr 18, 2016

It seems like only the initial fill is supported. The logic for dataFiller function is not wrapped into react-suitable way. So that as a user I could return a virtual dom.

@schovi
Copy link
Owner

schovi commented May 3, 2016

@kof Thanks for noticing. I will think about how to transform that into react way

@schovi schovi self-assigned this May 3, 2016
@geminiyellow
Copy link

geminiyellow commented May 11, 2016

that means react-iscroll not support infinite scroll yet?

@schovi
Copy link
Owner

schovi commented May 11, 2016

@geminiyellow Definitely not now. It works with raw html inside, which is not React way.

@schovi
Copy link
Owner

schovi commented May 12, 2016

Solution for now is to mix it with another library like https://github.com/alexcurtis/react-infscroll

@geminiyellow
Copy link

thank you @schovi . infinite scroll in redux is so hard.

@schovi
Copy link
Owner

schovi commented May 15, 2016

@geminiyellow I am working on solution. It will take some time, but there is first API for that. it combine auto loading and infinite scrolling (rendering really long list)
https://github.com/schovi/react-iscroll/blob/feature/infinite/example/examples/infinite.jsx

  1. new option infinite for setting up auto loading behaviour https://github.com/schovi/react-iscroll/blob/feature/infinite/example/examples/infinite.jsx#L10
  2. new event onLoadMore which is triggered when you reach end of scroll https://github.com/schovi/react-iscroll/blob/feature/infinite/example/examples/infinite.jsx#L74
  3. new component IScrollList which handle rendering of list items. I guess it could be used for every usage and not only infinite scrolling. It can still contain lot of optimalization for rendering. https://github.com/schovi/react-iscroll/blob/feature/infinite/example/examples/infinite.jsx#L76

Any suggestions, improvements or more features?

@schovi
Copy link
Owner

schovi commented May 15, 2016

What about leave core IScroll component alone and whole this infinite/list functionality leave on this new component?

@geminiyellow
Copy link

geminiyellow commented May 16, 2016

hi @schovi ,
thanks for your great work.

leave core IScroll component alone

yes, please keep the IScroll interface same with the official, let it alone. you can describe your project like this, based on iscroll but more powerful. LOL.

Any suggestions

ok, i think {this.state.list} is duplicate with this two line.

how about change the interface like react-virtualized, High-Order Components, this way, you can do more things.

or more features?

of cause, pull to refresh , other side of the infinite.

@schovi
Copy link
Owner

schovi commented May 16, 2016

@geminiyellow

react-virtualized just wow, amazing project, but reeeealy complex. My ambitions are much lower :)

High-Order Components, this way, you can do more things.

Can you give me specific simple example what you mean?

@geminiyellow
Copy link

@schovi yes, it is reeeealy complex, 😆

Can you give me specific simple example what you mean?

uh... i means let IScrollList work as a wrapper, not inside, like:

<IScrollList className="infinite-list" // classic html attributes
  items={this.state.list}   // list of items
  render={this.renderItem}  // item renderer function
  cache={1000}              // how many items is kept in cache
  prerender={10}            /* how many items is rendered before and after current viewport */ >
  <IScroll iScroll={iScroll} options={iScrollOptions} />
</IScrollList>

or:

IScrollList = IScrollList(IScroll, infinieOptions)

image

@orlowang
Copy link

@schovi this infinte example is not working 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants