Peter Kucera
07/10/2020, 10:40 AMKapil Godhwani
07/10/2020, 4:15 PMNativeViewModel
in the shared code. Wondering if that is needed for avoiding any concurrency issues on native or is it because android ends up using the standard android ViewModel
component and we are trying to create a VM for Native with almost the same functionality except android specific one.
Another query I had was, if instead of doing a MVVM architecture, if I create a project structure in MVP(going a bit old school), can I put both my Model and Presenter in common code and avoid creating 2 different ViewModels that are platform specific. Considering KaMP kit uses MVVM, I am sure this debate would have come up in the past and would be very glad if you could share its outcome and avoid me some future pains 😂.David Chavez
07/15/2020, 7:25 AMPeter Kucera
07/16/2020, 10:27 AMPeter Kucera
07/20/2020, 2:54 PMAlex Trotsenko
07/24/2020, 10:36 PMPeter Kucera
07/28/2020, 10:15 AMDaniele B
08/07/2020, 1:15 PMAlberto
08/10/2020, 4:28 PMDaniele B
08/12/2020, 11:33 AMDaniele B
08/12/2020, 11:47 AMromtsn
08/19/2020, 1:28 PMval dbConfig = DatabaseConfiguration(
name = "name.db",
version = MyDb.Schema.version,
create = { connection -> wrapConnection(connection) { MyDb.Schema.create(it) } },
upgrade = { connection, oldVersion, newVersion ->
wrapConnection(connection) {
MyDb.Schema.migrate(it, oldVersion, newVersion)
}
},
basePath = customDirPath,
key = key,
journalMode = JournalMode.DELETE
)
Thanks!kpgalligan
08/24/2020, 1:38 PMwithContext(Dispatchers.Default) {
log.e { "Never get's executed" }
log.e { "Never called" }
}
references log
, which is a field of BreedModel
. That will cause BreedModel
to freeze when coroutines tries to run that block on a different thread. That happens inside of coroutines “machinery”, which prior to native, didn’t really expect passing state between threads to throw exceptions. ensureNeverFrozen()
is new and coroutines hasn’t always dealt with it properly. I’ve seen some bugs submitted about it. Also, look at other output and see if you see anything about coroutines and “machinery”. Sometimes you will see that.Ivann Ruiz
08/27/2020, 7:17 PMandroidMain
folder in the android view doesn't show. However, I can see that folder when I switch to the project view. Do you all see the same? it should be visible in the android view as well...zsperske
08/31/2020, 1:50 AMiOSTest
directory and noticed there isn't a corresponding block in the build.gradle, are its dependencies inherited from iOSMain
or am I missing something?Daniele B
08/31/2020, 3:15 PMandroidMain
has org.jetbrains.kotlinx:kotlinx-coroutines-android
, but in my project it seems to compile also without specifying it.
However it doesn’t compile if from androidMain
I remove io.ktor:ktor-client-android
.
Can anyone give an explanation?
Is there a reason why Ktor requires the android-specific library and coroutines doesn’t?Daniele B
08/31/2020, 3:31 PMkotlin-serialization
and sometimes as kotlinx-serialization
.
I have seen it specified in different ways:
1) as plugins{ id("kotlinx-serialization") }
in *common*’s build.gradle.kts file
2) as plugins{ kotlin("plugin.serialization") }
in *common*’s build.gradle.kts file
3) as kotlin{ sourceSets{ dependencies{ implementation("org.jetbrains.kotlinx:kotlinx-serialization-core) }}}
in *common*’s build.gradle.kts file
4) as buildscript{ dependencies{ classpath("org.jetbrains.kotlin:kotlin-serialization") }}
in project-level build.gradle.kts filePeter Kucera
09/01/2020, 12:40 PMDaniele B
09/01/2020, 2:53 PMPeter Kucera
09/04/2020, 3:40 PMIan Arbuckle
09/05/2020, 1:38 PMios()
target? https://github.com/touchlab/KaMPKit/issues/133Peter Kucera
09/15/2020, 3:52 PMkpgalligan
10/15/2020, 1:51 PMbuildscript {
repositories {
google()
mavenCentral() //<-- This
jcenter()
}
dependencies {
classpath(Deps.android_gradle_plugin)
classpath(Deps.SqlDelight.gradle)
classpath(Deps.cocoapodsext)
classpath("org.jetbrains.kotlin:kotlin-serialization:${Versions.kotlin}")
classpath(kotlin("gradle-plugin", Versions.kotlin))
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build gradle files
}
}
kpgalligan
10/16/2020, 7:50 PMReshadf
11/13/2020, 12:36 PMPeter Kucera
11/16/2020, 1:28 PMCamiloVega
12/17/2020, 8:39 PMkpgalligan
12/29/2020, 4:07 PMPaul Woitaschek
02/04/2021, 8:23 AMe: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class co.touchlab.stately.collections.IsoMutableMap, unresolved supertypes: co.touchlab.stately.isolate.IsolateState
It seems it has no dependency on stately-isolate
Lena Stepanova
02/10/2021, 1:45 PMsuspend fun <T: Any> Transacter.transactionWithContextResult(
coroutineContext: CoroutineContext,
noEnclosing: Boolean = false,
body: TransactionWithReturn<T>.() -> T
): T {
return withContext(coroutineContext) {
this@transactionWithContextResult.transactionWithResult(noEnclosing) { body }
}
}
Using in DatabaseHelper:
suspend fun getAllItems(): List<Item> {
dbRef.transactionWithContextResult<List<Item>>(backgroundDispatcher) {
dbQueries.getAllItems(::mapItemsSelecting).executeAsList()
}
}
Lena Stepanova
02/10/2021, 1:45 PMsuspend fun <T: Any> Transacter.transactionWithContextResult(
coroutineContext: CoroutineContext,
noEnclosing: Boolean = false,
body: TransactionWithReturn<T>.() -> T
): T {
return withContext(coroutineContext) {
this@transactionWithContextResult.transactionWithResult(noEnclosing) { body }
}
}
Using in DatabaseHelper:
suspend fun getAllItems(): List<Item> {
dbRef.transactionWithContextResult<List<Item>>(backgroundDispatcher) {
dbQueries.getAllItems(::mapItemsSelecting).executeAsList()
}
}
romtsn
02/11/2021, 9:04 AMLena Stepanova
02/11/2021, 9:08 AMromtsn
02/11/2021, 9:09 AMbody
actually, so change it to either body.invoke()
or just body()
Lena Stepanova
02/11/2021, 9:11 AM