Comments (4)
Hi @colintheshots. I added a refresh function on 0.6.0. Haven't really tested but just added it based on your comment above and used PagingSource.invalidate()
from multiplatform-paging.
Sorry for getting back to this late. The reason here is that for Android when you refresh, it's going to come from the adapter so we can't access it in the common code. Do you have any suggestions on how to make this possible in common code?
from multiplatform-paging.
I need to think this one over. I haven't had a chance to investigate what it might take yet.
from multiplatform-paging.
@kuuuurt using PageSource.invalidate method might work.
That's a comment from PagingDataAdapter:
/** * Refresh the data presented by this [PagingDataAdapter]. * * [refresh] triggers the creation of a new [PagingData] with a new instance of [PagingSource] * to represent an updated snapshot of the backing dataset. If a [RemoteMediator] is set, * calling [refresh] will also trigger a call to [RemoteMediator.load] with [LoadType] [REFRESH] * to allow [RemoteMediator] to check for updates to the dataset backing [PagingSource]. * * Note: This API is intended for UI-driven refresh signals, such as swipe-to-refresh. * Invalidation due repository-layer signals, such as DB-updates, should instead use * [PagingSource.invalidate]. */ fun refresh()
A comment from Pager:
/** * A cold [Flow] of [PagingData], which emits new instances of [PagingData] once they become * invalidated by [PagingSource.invalidate] or calls to [AsyncPagingDataDiffer.refresh] or * [PagingDataAdapter.refresh]. */ @OptIn(androidx.paging.ExperimentalPagingApi::class) public val flow: Flow<PagingData<Value>>
from multiplatform-paging.
Related Issues (20)
- Could not resolve all files for configuration ':shared:jvmCompileClasspath'
- Paging lib is invisible after adding the dependency to commonMain. HOT 1
- Kotlin 1.5 support HOT 7
- Javascript support? HOT 1
- Mispell in dependency name in readme HOT 2
- Pager tries to mutate a frozen list on iOS HOT 3
- Fix your readme please! HOT 2
- Allow invalidation of paging data HOT 4
- Apple Silicon (M1) support? HOT 6
- Add SwiftUI Support HOT 3
- Not able to find paging functions in Android HOT 1
- Issues in using map on PagingData for IOS
- ios resetPager problem HOT 2
- Placeholders support
- IOS not Building on version 0.5.0
- Crash on Android when refreshing (version 0.6.x) HOT 1
- iOS refresh logic is weird
- Empty PagingData list HOT 2
- Where's version 0.3.9? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multiplatform-paging.