Skip to content

Commit

Permalink
Solving a few other problems
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownJoe796 committed Mar 27, 2024
1 parent b54b1bf commit 5321a61
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class ModelCache<T : HasId<ID>, ID : Comparable<ID>>(

override fun get(id: ID): WritableModel<T> = cache.getOrPut(id) { WritableModelImpl(id) }

override suspend fun watch(id: ID): WritableModel<T> {
override fun watch(id: ID): WritableModel<T> {
val original = cache.getOrPut(id) { WritableModelImpl(id) }
return object : WritableModel<T> by original {
override fun addListener(listener: () -> Unit): () -> Unit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ interface ModelCollection<T : HasId<ID>, ID : Comparable<ID>> {
operator fun get(id: ID): WritableModel<T>
suspend fun query(query: Query<T>): Readable<List<T>>
suspend fun watch(query: Query<T>): Readable<List<T>>
suspend fun watch(id: ID): WritableModel<T> = get(id)
fun watch(id: ID): WritableModel<T> = get(id)
suspend fun insert(item: T): WritableModel<T>
suspend fun insert(item: List<T>): List<T>
suspend fun upsert(item: T): WritableModel<T>
Expand Down

0 comments on commit 5321a61

Please sign in to comment.