As proposed in #4, Extends the Counter API to enable increment and decrement of the counter's value using addition assignment and subtraction assignment operators e.g.
struct Schema: Codable, Equatable {
var counter: Counter?
}
var doc1 = Document(Schema())
let _ = doc1.change {
$0.counter?.set(3)
}
let _ = doc1.change {
$0.counter -= 1
XCTAssertEqual($0.counter?.get(), 2)
}
let _ = doc1.change {
$0.counter += 1
XCTAssertEqual($0.counter?.get(), 3)
}
As proposed in #4, Extends the Counter API to enable increment and decrement of the counter's value using addition assignment and subtraction assignment operators e.g.