Skip to content

Conversation

ZacSweers
Copy link
Collaborator

No description provided.

timeout: Duration? = null,
name: String? = null,
policy: SnapshotMutationPolicy<UiState> = structuralEqualityPolicy(),
retainedStateRegistry: RetainedStateRegistry = RetainedStateRegistry(),
Copy link
Contributor

@chrisbanes chrisbanes Sep 16, 2024

Choose a reason for hiding this comment

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

WDYT to making this nullable (and default to null)?

Providing a default retainedStateRegistry is a bit of a foot gun, as it's so easy for devs to ignore. At least if we force people to provide a value, it's on them to track. If they don't provide a value, nothing is retained anyway.

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'd be game for that or default to NoopStateRegistry, though I'm still not sure this API is necessary to expose at the top level as the only use case right now was automatic-cleanup.

Copy link
Contributor

@chrisbanes chrisbanes Sep 16, 2024

Choose a reason for hiding this comment

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

Yeah, this is basically just recreating NoopStateRegistry. Maybe this PR isn't needed: if people want to provide a real registry in tests then they're free to do so. Might be worth a doc call out though.

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.

2 participants