android / codelab-android-paging

Jetpack Paging codelab
Apache License 2.0
494 stars 263 forks source link

Different code between codelabs and github #194

Closed ichvandi closed 3 years ago

ichvandi commented 3 years ago

Data is not fetched at the first time because in the codelabs code, at searches variable, it is not calling method .onStart { ... }, but in github actually we need to call it.

Codelabs (page 7) Github
Codelabs Image Github Image

Codelabs

val searches = actionStateFlow
            .filterIsInstance<UiAction.Search>()
            .distinctUntilChanged()

Github

val searches = actionStateFlow
            .filterIsInstance<UiAction.Search>()
            .distinctUntilChanged()
            .onStart { emit(UiAction.Search(query = initialQuery)) }

also in codelabs (page 9) said We can now remove binding.list.scrollToPosition(0) from updateRepoListFromInput()., but in codelabs and github the code isn't removed image

tunjid commented 3 years ago

Oh wow, thanks for catching this! I'll fix it as soon as I'm able to.

tunjid commented 3 years ago

Fixed.