I’ve learn the migration information and am nonetheless caught on this one. Within the spirit of the migration information …
OLD
class MyClass: ObservableObject {
@Revealed var myVariable: String = "Must know"
var subscriptions: Set<AnyCancellable> = []
init() {
$myVariable.sink { updated_variable in
//Must function
}.retailer(in: &subscriptions)
}
}
NEW
@Observable class MyClass {
var myVariable: String = "Must know"
var subscriptions: Set<AnyCancellable> = []
init() {
/*
Error!
Can't discover '$myVariable' in scope
*/
$myVariable.sink { updated_variable in
//Must function
}.retailer(in: &subscriptions)
}
}
I actually appreciated subscribing to and for that matter assigning to @Revealed variables with mix. Can I nonetheless do that in any method?