Observing Resources
-
Something that can observe changes to the state of a
Resource
. “State” meanslatestData
,latestError
, andisLoading
.Any code that wants to display or process a resource’s content should register itself as an observer using
See moreResource.addObserver(...)
.Declaration
Swift
public protocol ResourceObserver
-
A closure alternative to
ResourceObserver
.Declaration
Swift
public typealias ResourceObserverClosure = (Resource, ResourceEvent) -> Void
-
The possible causes of a call to
ResourceObserver.resourceChanged(_:event:)
.See also
Resource.load()
Declaration
Swift
public enum ResourceEvent