Skip to content

Commit

Permalink
⬆️ Dependency updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Bryant committed Feb 21, 2022
1 parent 480d6c2 commit ab4378e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
13 changes: 6 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
buildscript {
ext {
kotlin_version = '1.5.31'
compose_version = '1.0.4'

kotlin_version = '1.6.10'
compose_version = '1.1.0'
}
repositories {
google()
Expand All @@ -12,16 +11,16 @@ buildscript {
}
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
classpath "com.android.tools.build:gradle:7.0.4"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
classpath 'org.jlleitschuh.gradle:ktlint-gradle:10.2.0'
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.5.30"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.6.10"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}

plugins {
id("org.jetbrains.dokka") version "1.5.30"
id("org.jetbrains.dokka") version "1.6.10"
}

subprojects {
Expand Down
4 changes: 2 additions & 2 deletions compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ ktlint {

dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'

implementation "androidx.compose.ui:ui:$compose_version"
api project(path: ':core')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.ptrbrynt.kotlin_bloc.compose

import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.produceState
import com.ptrbrynt.kotlin_bloc.core.BlocBase
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.map

/**
Expand Down Expand Up @@ -32,7 +33,9 @@ fun <B : BlocBase<State>, State, T> BlocSelector(
selector: (State) -> T,
content: @Composable (T) -> Unit,
) {
val state by bloc.stateFlow.map { selector(it) }.collectAsState(initial = selector(bloc.state))
val state by produceState(initialValue = selector(bloc.state)) {
bloc.stateFlow.map { selector(it) }.collect { value = it }
}

content(state)
}
6 changes: 3 additions & 3 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ ktlint {
dependencies {

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
implementation 'androidx.activity:activity-compose:1.4.0'
implementation project(path: ':compose')
testImplementation project(path: ':test')
Expand Down
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
}
}
rootProject.name = "KotlinBloc"
Expand Down

0 comments on commit ab4378e

Please sign in to comment.