Skip to content

Commit

Permalink
fixes events
Browse files Browse the repository at this point in the history
  • Loading branch information
micheleriva committed Jul 20, 2024
1 parent ee2b1b2 commit a8dd6a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ let answerSessionParams = AnswerParams<E2EDoc>(
)

let answerSession = AnswerSession(params: answerSessionParams)
.on(event: .stateChange, callback: { state in print(state) })
.on(event: .relatedQueries, callback: { related in print(related) })
.on(event: .stateChange) { print($0) }
.on(event: .relatedQueries) { print($0) }

let askParams = AnswerParams<E2EDoc>.AskParams(
query: "What's the best movie to watch with the family?",
Expand Down
4 changes: 2 additions & 2 deletions Tests/oramacloud-clientTests/oramacloud_clientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ final class oramacloud_clientTests: XCTestCase {
let expectation = XCTestExpectation(description: "Message loading event called")
var events: [Bool] = []

_ = answerSession.on(event: .messageLoading) { isLoading in
events.append(isLoading as! Bool)
_ = answerSession.on(event: .messageLoading) {
events.append($0 as! Bool)
if events.count == 2 { // Expecting two events: true and false
expectation.fulfill()
}
Expand Down

0 comments on commit a8dd6a2

Please sign in to comment.