The @Queryable
property wrapper has been replaced by a Queryable
class conforming to ObservableObject
that you can define anywhere, inside as well as outside the SwiftUI environment (e.g. in a view model or some other class a view has a access to).
In all your views, replace the following line:
@Queryable<Input, Result> var myQueryable
with this:
@StateObject var myQueryable = Queryable<Input, Result>
The @StateObject
is only there to let SwiftUI handle the lifecycle of the object, it serves no other purpose.
If you pass a reference of a Queryable down the view hierarchy, replace this:
var myQueryable: Queryable<Input, Result>.Trigger
with this:
var myQueryable Queryable<Input, Result>
All the calls to the .queryable[...]
view modifiers will still work as before, no changes are needed.
The logger configuration call has moved outside the generic class. Replace the following line:
Queryable<Void, Void>.configureLog()
with this:
QueryableLogger.configure()