Skip to content

Commit ab4378e

Browse files
author
Peter Bryant
committed
⬆️ Dependency updates
1 parent 480d6c2 commit ab4378e

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
buildscript {
22
ext {
3-
kotlin_version = '1.5.31'
4-
compose_version = '1.0.4'
5-
3+
kotlin_version = '1.6.10'
4+
compose_version = '1.1.0'
65
}
76
repositories {
87
google()
@@ -12,16 +11,16 @@ buildscript {
1211
}
1312
}
1413
dependencies {
15-
classpath "com.android.tools.build:gradle:7.0.3"
16-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
14+
classpath "com.android.tools.build:gradle:7.0.4"
15+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
1716
classpath 'org.jlleitschuh.gradle:ktlint-gradle:10.2.0'
18-
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.5.30"
17+
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.6.10"
1918
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
2019
}
2120
}
2221

2322
plugins {
24-
id("org.jetbrains.dokka") version "1.5.30"
23+
id("org.jetbrains.dokka") version "1.6.10"
2524
}
2625

2726
subprojects {

compose/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ ktlint {
7373

7474
dependencies {
7575
implementation 'androidx.core:core-ktx:1.7.0'
76-
implementation 'androidx.appcompat:appcompat:1.3.1'
77-
implementation 'com.google.android.material:material:1.4.0'
76+
implementation 'androidx.appcompat:appcompat:1.4.1'
77+
implementation 'com.google.android.material:material:1.5.0'
7878

7979
implementation "androidx.compose.ui:ui:$compose_version"
8080
api project(path: ':core')

compose/src/main/java/com/ptrbrynt/kotlin_bloc/compose/BlocSelector.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package com.ptrbrynt.kotlin_bloc.compose
22

33
import androidx.compose.runtime.Composable
4-
import androidx.compose.runtime.collectAsState
54
import androidx.compose.runtime.getValue
5+
import androidx.compose.runtime.produceState
66
import com.ptrbrynt.kotlin_bloc.core.BlocBase
7+
import kotlinx.coroutines.flow.collect
78
import kotlinx.coroutines.flow.map
89

910
/**
@@ -32,7 +33,9 @@ fun <B : BlocBase<State>, State, T> BlocSelector(
3233
selector: (State) -> T,
3334
content: @Composable (T) -> Unit,
3435
) {
35-
val state by bloc.stateFlow.map { selector(it) }.collectAsState(initial = selector(bloc.state))
36+
val state by produceState(initialValue = selector(bloc.state)) {
37+
bloc.stateFlow.map { selector(it) }.collect { value = it }
38+
}
3639

3740
content(state)
3841
}

sample/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ ktlint {
5959
dependencies {
6060

6161
implementation 'androidx.core:core-ktx:1.7.0'
62-
implementation 'androidx.appcompat:appcompat:1.3.1'
63-
implementation 'com.google.android.material:material:1.4.0'
62+
implementation 'androidx.appcompat:appcompat:1.4.1'
63+
implementation 'com.google.android.material:material:1.5.0'
6464
implementation "androidx.compose.ui:ui:$compose_version"
6565
implementation "androidx.compose.material:material:$compose_version"
6666
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
67-
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
67+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
6868
implementation 'androidx.activity:activity-compose:1.4.0'
6969
implementation project(path: ':compose')
7070
testImplementation project(path: ':test')

settings.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ dependencyResolutionManagement {
33
repositories {
44
google()
55
mavenCentral()
6-
jcenter() // Warning: this repository is going to shut down soon
76
}
87
}
98
rootProject.name = "KotlinBloc"

0 commit comments

Comments
 (0)