ReactiveNamespace
public struct ReactiveNamespace
Combine utilities for the ListPublisher
are exposed through this namespace. Extend this type if you need to add other Combine Publisher utilities for ListPublisher
.
-
The
ListPublisher
instanceDeclaration
Swift
public let base: ListPublisher
-
Returns a
Publisher
that emits aListSnapshot
whenever changes occur in theListPublisher
listPublisher.reactive .snapshot(emitInitialValue: true) .sink( receiveCompletion: { result in // ... }, receiveValue: { (listSnapshot) in dataSource.apply( listSnapshot, animatingDifferences: true ) } ) .store(in: &cancellables)
Declaration
Swift
public func snapshot(emitInitialValue: Bool = true) -> ListPublisher.SnapshotPublisher
Parameters
emitInitialValue
If
true
, the current value is immediately emitted to the first subscriber. Iffalse
, the event fires only starting the nextListSnapshot
update.Return Value
A
Publisher
that emits aListSnapshot
whenever changes occur in theListPublisher
.