Merge pull request #1 from cozzin/objectWillChange

Fix object will change
This commit is contained in:
DreamPiggy 2019-09-12 22:51:52 +08:00 committed by GitHub
commit 6f073d4fea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -11,18 +11,15 @@ import Combine
import SDWebImage
class ImageManager : ObservableObject {
var willChange = PassthroughSubject<ImageManager, Never>()
var didChange = PassthroughSubject<ImageManager, Never>()
var objectWillChange = PassthroughSubject<ImageManager, Never>()
private var manager = SDWebImageManager.shared
private weak var currentOperation: SDWebImageOperation? = nil
var image: Image? {
willSet {
willChange.send(self)
}
didSet {
didChange.send(self)
objectWillChange.send(self)
}
}