BreakZero / EasyWallet-KMP

A Web3 decentralized wallet
5 stars 2 forks source link

PagingCollectionViewController<T: Products> issue #38

Closed DidarSeyidov closed 3 weeks ago

DidarSeyidov commented 3 weeks ago
func startLoadProductss() {
    Task {
        try? await asyncSequence(for: getProducts()).collect { pagingData in
              try? await delegate.submitData(pagingData: pagingData)

        }
    }
}

I thing there is a problem on above function, it returns always empty [ ] list, and when I set input data type to Any on PagingCollectionViewController, swiftUI cannot recognize Any type, please help

BreakZero commented 3 weeks ago

Hi @DidarSeyidov for empty list, could you check what the result you get from getProducts?

DidarSeyidov commented 3 weeks ago

@NativeCoroutines fun getProducts(): Flow<PagingData> { return Pager( config = PagingConfig(pageSize = 30), pagingSourceFactory = { dataSource.fetchProducts() } ).flow }

BreakZero commented 3 weeks ago

Yes, you can log the result to check if the flow emit the empty list. For Any data type, you can see more here

DidarSeyidov commented 3 weeks ago

suspend fun submitData(pagingData: PagingData) { differ.submitData(pagingData) } Is @NativeCoroutines missed on this function?