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
NotificationToken
produced 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. TheNotificationToken
will be saved on the specifiedKeyPath
from 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
object
The object which the
NotificationToken
is written to.keyPath
The KeyPath which the
NotificationToken
is written to.Return Value
A
WillChangeWithToken
Publisher.