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

Allow Unit for ResultRecipient #139

Open
margarita-v opened this issue May 22, 2022 · 0 comments
Open

Allow Unit for ResultRecipient #139

margarita-v opened this issue May 22, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@margarita-v
Copy link
Contributor

margarita-v commented May 22, 2022

Currently, it's impossible to use Unit as a result type for ResultRecipient according to InitialValidator.validateResultType, though would be useful as a sign of completed work without data.

UPD I've tried to achieve it (simply extend primitives list for InitialValidator.validateResultType), but it seems to be a restriction of SavedStateHandle.ACCEPTABLE_CLASSES:

    java.lang.IllegalArgumentException: Can't put value with type class kotlin.Unit into saved state
        at androidx.lifecycle.SavedStateHandle.validateValue(SavedStateHandle.java:271)
        at androidx.lifecycle.SavedStateHandle.set(SavedStateHandle.java:251)
        at com.ramcosta.composedestinations.result.ResultBackNavigatorImpl.setResult(ResultBackNavigatorImpl.kt:30)
@raamcosta raamcosta added the enhancement New feature or request label May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants