Infinite Loading FlexTable: Dataset Of One Causes State Problem
See original GitHub issueHey there!
I think I found a bug, or… I am just missing something obvious.
Thanks for your work on RV!
Issue Loading a single item list into an Infinite Loading FlexTable prevents any future changes, even after a clearing of state.
My guess would be how the caching is being done, but I wasn’t able to make any headway on that.
Steps
- Take the Gist below and replace InfiniteLoader.example.js in the RV source with it.
- Start server, go to InfiniteLoader, etc.
- Click ‘Only Two’.
- This should give you only two results.
- Click ‘Multi-Page’.
- This should give you a standard Infinite list.
- Click ‘Clear Data’.
- This should… clear the data.
- Try any order combination of those 3 buttons.
- This should not break anything…
- Click ‘Only One’.
- This should give you only one result.
- Click ‘Only Two’ or ‘Multi-Page’.
- This should hang at loading.
- Click ‘Clear Data’.
- This should clear the table, but no further button clicks will load results.
tl;dr - Once a result of a single row is loaded you can’t un-stick it.
// Line 39: If you change this...
const rowCount = hasNextPage ? list.size + 1 : list.size;
// Into this...
const rowCount = hasNextPage ? list.size + 2 : list.size;
// But you are left with an extra loading row showing.
Example Gist
❤️
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:12 (7 by maintainers)
Top Results From Across the Web
InfiniteLoader#loadMoreRows invoked multiple times per scroll
Upon scrolling, InfiniteLoader#loadMoreRows is invoked multiple ... Infinite Loading FlexTable: Dataset Of One Causes State Problem #361.
Read more >I'm having trouble loading the 'flextable' package. - General
I've come across a few proposed solutions on stackoverflow and in github issues, but I haven't been able to find a solution to...
Read more >Package 'data.table' - R Project
It offers fast and memory efficient: file reader and writer, aggregations, updates, equi, non-equi, rolling, range and interval joins, in a ...
Read more >Fixed- and Mixed-Effects Regression Models in R
In a first step, we load functions that we may need (which in this ... If unchecked, then such issues could go unnoticed...
Read more >Extreme Management Center®Known Restrictions and ...
Problem 6: Extreme Management Center does not support restoring a database that was saved on a Linux system to a Windows system. Problem...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well, it does work, but not ideally. 😛
_loadMoreRows
gets called twice, and therefore does two API calls ( your gist does this as well ). Granted, this can be worked around by making a check for it being an initial call or something like that. I was just hoping to have to avoid that kind of thing. 😄I was thinking, how would you feel about a public function on
InfiniteLoader
to clear the memoized data? The reason I ask is that I’ve ran into another snag, but this time with a result set of zero. While I can get around it by forcingthis._loadMoreRows
usingcomponentDidUpdate
, managing when ( much more importantly when not! ) to do that is hairy ( in my situation at least ). Being able to clear the memoized cache manually when I call mythis._clearData()
function would be ideal ( for me at least ).