George
09/29/2022, 8:25 AMpackage kotlinx.coroutines.flow
. I guess this is for easier discover-ability?. I am wondering if i can use also this pattern when i seem fit in my application code or it is not recommended at all.? Thanks in advance for any help and answers ! Also how come the intelij warning is not suppressed (@file:Suppress("PackageDirectoryMismatch"))? Does not that lead to confusion if the package is intentional or not ?simon.vergauwen
09/29/2022, 8:28 AM@file:JvmMultifileClass
and an explicit name @file:JvmName("FlowKt")
.
https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/common/src/flow/Builders.kt#L6simon.vergauwen
09/29/2022, 8:28 AMGeorge
09/29/2022, 8:30 AMservice
package and i use some extensions in all my services. for example a ResponseHandler. I think it would be better to be placed in another package inside service
but would like to keep the ability to discover it without importing.simon.vergauwen
09/29/2022, 8:31 AMpredef.kt
file without a package name. IIRC, it doesn't need importing in that case.George
09/29/2022, 8:34 AM//package org.msensis.imahub.workhorse.service.converters
import imahub.sdk.hub.HubPayload
interface HubPayloadConverter<out T> {
fun convert(): HubPayload<T>
}
?simon.vergauwen
09/29/2022, 8:35 AMGeorge
09/29/2022, 8:38 AMservice
intelij promts me to import it like this: import HubPayloadConverter
simon.vergauwen
09/29/2022, 8:40 AMimport example
without me noticing.
So you're only option would be to put it in the service
package, so it doesn't require imports in the service package.George
09/29/2022, 8:42 AMsimon.vergauwen
09/29/2022, 9:40 AM