Skip to content

Commit

Permalink
Spaces in sample function were causing headaches in Android
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Apr 23, 2020
1 parent be785b7 commit 19fbc40
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 13 additions & 5 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ group 'kweb'
version '0.3.1'

buildscript {
ext.kotlin_version = '1.3.70'
ext.dokka_version = '0.9.18'
ext.kotlin_version = '1.3.72'
ext.dokka_version = '0.10.1'

repositories {
jcenter()
Expand Down
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Thu Apr 23 08:58:13 CDT 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
10 changes: 5 additions & 5 deletions src/main/kotlin/kweb/shoebox/samples/samples.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import java.nio.file.Files
*/


fun `basic usage sample`() {
fun basic_usage_sample() {
val dir = Files.createTempDirectory("sb-")
val userStore = Shoebox<User>(dir.resolve("users"))
val usersByEmail = View(Shoebox(dir.resolve("usersByEmail")), userStore, viewBy = User::email)
Expand All @@ -23,12 +23,12 @@ fun `basic usage sample`() {
println(usersByGender["male"]) // [User(name=Ian Clarke, gender=male, [email protected]),
// User(name=Fred Smith, gender=male, [email protected])]
// note: view["xx]" returns a set of values
usersByGender.onAdd("male", {kv ->
usersByGender.onAdd("male") { kv ->
println("${kv.key} became male")
})
usersByGender.onRemove("male", {kv ->
}
usersByGender.onRemove("male") { kv ->
println("${kv.key} ceased to be male")
})
}

userStore["fred"] = userStore["fred"]!!.copy(gender = "female") // Prints "fred ceased to be male"
}
Expand Down

0 comments on commit 19fbc40

Please sign in to comment.