``` val likesCount = when(post) { ...
# arrow
a
Copy code
val likesCount = when(post) {
                is None -> None
                is Some ->
                    s.readTransactionAsync { tx ->
                        tx.runAsync(notificationQuery, parameters("postId", it.a))
                                .thenCompose(StatementResultCursor::peekAsync)
                                .thenApply { record ->
                                    Some(record["likesCount"].asInt())
                                }
                    }.await()
            }
hmm I did it this way... If there is a better way, please suggest