Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract an interface for LoadingStrategy #2217

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

swankjesse
Copy link
Collaborator


  • CHANGELOG.md's "Unreleased" section has been updated, if applicable.

@swankjesse swankjesse marked this pull request as ready for review July 31, 2024 01:14
*/
package app.cash.redwood.lazylayout.compose

public interface LoadingStrategy {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted this because I was writing a test for some internal Cash code and I didn’t like my test accidentally exercising all of this policy.

Copy link
Collaborator

@dnagler dnagler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool idea!

@swankjesse swankjesse merged commit 63f55f8 into trunk Jul 31, 2024
11 checks passed
@swankjesse swankjesse deleted the jwilson.0730.LoadingStrategy branch July 31, 2024 16:24
Comment on lines 33 to +34
return rememberSaveable(saver = saver) {
LazyListState()
LazyListState(strategy)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like strategy needs to be added as a key to rememberSaveable. Otherwise changes in strategies would not reinitialize the state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants