WillChange
@frozen
public struct WillChange<Collection> : Publisher where Collection : RealmSubscribable, Collection : ThreadConfined
A publisher which emits Void each time the object is mutated.
Despite the name, this actually emits after the collection has changed.
-
This publisher cannot fail.
Declaration
Swift
public typealias Failure = Never -
This publisher emits Void.
Declaration
Swift
public typealias Output = Void -
Captures the
NotificationTokenproduced by observing a Realm Collection.This allows you to do notification skipping when performing a
Realm.write(withoutNotifying:). You should use this call if you require to write to the Realm database and ignore this specific observation chain. TheNotificationTokenwill be saved on the specifiedKeyPathfrom the observation block set up inreceive(subscriber:).Declaration
Swift
public func saveToken<T>(on object: T, at keyPath: WritableKeyPath<T, NotificationToken?>) -> WillChangeWithToken<Collection, T>Parameters
objectThe object which the
NotificationTokenis written to.keyPathThe KeyPath which the
NotificationTokenis written to.Return Value
A
WillChangeWithTokenPublisher.
View on GitHub
Install in Dash