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

Add Parceler and WriteWith #51

Closed
arkivanov opened this issue Jun 21, 2022 · 1 comment
Closed

Add Parceler and WriteWith #51

arkivanov opened this issue Jun 21, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@arkivanov
Copy link
Owner

This should be placed in the parcelable module.

See the discussion #47.

Here is a tentative implementation from the discussion:

// Parceler.kt in commonMain

expect interface Parceler<T>
// WriteWith.kt in commonMain

@OptIn(ExperimentalMultiplatform::class)
@OptionalExpectation
@Target(AnnotationTarget.TYPE)
expect annotation class WriteWith<P : Parceler<*>>()
// Parceler.kt in androidMain

actual typealias Parceler<T> = kotlinx.parcelize.Parceler<T>
// WriteWith.kt in androidMain

actual typealias WriteWith<P> = kotlinx.parcelize.WriteWith<P>
// Parceler.kt in nonAndroidMain

actual interface Parceler<T>
@arkivanov arkivanov added the enhancement New feature or request label Jun 21, 2022
@arkivanov
Copy link
Owner Author

Closed via #52

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

1 participant