RealmWillChange

public struct RealmWillChange : Publisher

A publisher which emits Void each time the Realm is refreshed.

Despite the name, this actually emits after the Realm is refreshed.

  • 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. The NotificationToken will be saved on the specified KeyPathfrom the observation block set up in receive(subscriber:).

    Declaration

    Swift

    public func saveToken<T>(on object: T, for keyPath: WritableKeyPath<T, NotificationToken?>) -> RealmWillChangeWithToken<T>

    Parameters

    object

    The object which the NotificationToken is written to.

    keyPath

    The KeyPath which the NotificationToken is written to.

    Return Value

    A RealmWillChangeWithToken Publisher.