Publishers

@available(OSX 10.15, watchOS 6.0, iOS 13.0, iOSApplicationExtension 13.0, OSXApplicationExtension 10.15, tvOS 13.0, *)
public enum Publishers

Combine publishers for Realm types.

You normally should not create any of these types directly, and should instead use the extension methods which create them.

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

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

    See more

    Declaration

    Swift

    public struct RealmWillChange : Publisher
  • A publisher which emits Void each time the object is mutated.

    Despite the name, this actually emits after the collection has changed.

    See more

    Declaration

    Swift

    public struct WillChange<Collection> : Publisher where Collection : RealmSubscribable, Collection : ThreadConfined
  • A publisher which emits an object or collection each time that object is mutated.

    See more

    Declaration

    Swift

    public struct Value<Subscribable> : Publisher where Subscribable : RealmSubscribable, Subscribable : ThreadConfined
  • A helper publisher used to support receive(on:) on Realm publishers.

    Declaration

    Swift

    public struct Handover<Upstream, S> : Publisher where Upstream : Publisher, S : Scheduler, Upstream.Output : ThreadConfined
  • A publisher which makes receive(on:) work for streams of thread-confined objects

    Create using .threadSafeReference()

    See more

    Declaration

    Swift

    public struct MakeThreadSafe<Upstream> : Publisher where Upstream : Publisher, Upstream.Output : ThreadConfined
  • A publisher which delivers thread-confined values to a serial dispatch queue.

    Create using .threadSafeReference().receive(on: queue) on a publisher that emits thread-confined objects.

    Declaration

    Swift

    public struct DeferredHandover<Upstream, S> : Publisher where Upstream : Publisher, S : Scheduler, Upstream.Output : ThreadConfined
  • A publisher which emits ObjectChange each time the observed object is modified

    receive(on:) and subscribe(on:) can be called directly on this publisher, and calling .threadSafeReference() is only required if there is an intermediate transform. If subscribe(on:) is used, it should always be the first operation in the pipeline.

    Create this publisher using the objectChangeset() function.

    See more

    Declaration

    Swift

    public struct ObjectChangeset<T> : Publisher where T : Object
  • A helper publisher created by calling .threadSafeReference() on a publisher which emits thread-confined values.

    See more

    Declaration

    Swift

    public struct MakeThreadSafeObjectChangeset<Upstream, T> : Publisher where Upstream : Publisher, T : Object, Upstream.Output == ObjectChange<T>
  • A publisher which delivers thread-confined object changesets to a serial dispatch queue.

    Create using .threadSafeReference().receive(on: queue) on a publisher that emits ObjectChange.

    Declaration

    Swift

    public struct DeferredHandoverObjectChangeset<Upstream, T, S> : Publisher where Upstream : Publisher, T : Object, S : Scheduler, Upstream.Output == ObjectChange<T>
  • A publisher which emits RealmCollectionChange each time the observed object is modified

    receive(on:) and subscribe(on:) can be called directly on this publisher, and calling .threadSafeReference() is only required if there is an intermediate transform. If subscribe(on:) is used, it should always be the first operation in the pipeline.

    Create this publisher using the changesetPublisher property on RealmCollection..

    See more

    Declaration

    Swift

    public struct CollectionChangeset<Collection> : Publisher where Collection : RealmCollection
  • A helper publisher created by calling .threadSafeReference() on a publisher which emits RealmCollectionChange.

    See more

    Declaration

    Swift

    public struct MakeThreadSafeCollectionChangeset<Upstream, T> : Publisher where Upstream : Publisher, T : RealmCollection, Upstream.Output == RealmCollectionChange<T>
  • A publisher which delivers thread-confined collection changesets to a serial dispatch queue.

    Create using .threadSafeReference().receive(on: queue) on a publisher that emits RealmCollectionChange.

    Declaration

    Swift

    public struct DeferredHandoverCollectionChangeset<Upstream, T, S> : Publisher where Upstream : Publisher, T : RealmCollection, S : Scheduler, Upstream.Output == RealmCollectionChange<T>
  • A publisher that emits a change event each time the remote MongoDB collection changes.

    See more

    Declaration

    Swift

    public struct WatchPublisher : Publisher