Code Monkey home page Code Monkey logo

Comments (3)

MrAlek avatar MrAlek commented on August 18, 2024

Thanks for setting up the issue.

I've been thinking about what to do with the last page, if it should be treated like all the others and require correct sizing or not. Since the array will mostly be used with a paging web service, the total count might differ from when you load the first page and you get the last.

What do you think, should I enforce correct sizing or make the array compensate on the last page itself?

from pagedarray.

alejandrogarin avatar alejandrogarin commented on August 18, 2024

I would not enforce the size in last page.
I came across this issue when adding a few methods to reorder, insert and delete elements in the array so I don't need to reload all the pages again.
I applied a local fix looping through the pages and collecting the elements.
I think that just returning the loaded elements avoiding the crash is good enough.

Sent from my iPhone

On May 11, 2015, at 4:49 PM, Alek ร…strรถm [email protected] wrote:

Thanks for setting up the issue.

I've been thinking about what to do with the last page, if it should be treated like all the others and require correct sizing or not. Since the array will mostly be used with a paging web service, the total count might differ from when you load the first page and you get the last.

What do you think, should I enforce correct sizing or make the array compensate on the last page itself?

โ€”
Reply to this email directly or view it on GitHub.

from pagedarray.

MrAlek avatar MrAlek commented on August 18, 2024

I've taken a different take on this now (3c70011). In the 0.2 version, you have two options:

  1. Adjust the count property on the paged array before setting the mis-sized page.
  2. Set the updatesCountWhenSettingPages property to true, which removes all page size checking and dynamically adjusts the paged array to fit. That also makes infinite lists easy to implement since you can just append new pages.

from pagedarray.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.