DittoSingleDocumentLiveQueryEvent
@objc
public class DittoSingleDocumentLiveQueryEvent : NSObject
Represents a change to a document by providing a value representing the document’s old state and a value
representing the document’s new state. If it is the first time that one of these events is delivered for
a DittoSingleDocumentLiveQuery
then the isInitial
value will be true
and the newDocument
value
will be populated, if there existed a document with the relevant ID. If there is no matching document
found then both oldDocument
and newDocument
will be nil
. If the document exists and is removed at a
later date then an event will be delivered where oldDocument
will be the most recent version of the
document and newDocument
will be nil
. Similarly, if there was no document with the relevant ID and a
document with the ID is later added then an event will be delivered where oldDocument
is nil
and
newDocument
will be the document as it was just inserted.
-
States whether or not the event is the initial event delivered as part of an
observe
orobserveLocal
call.Declaration
Swift
@objc public let isInitial: Bool
-
The old representation of the document with the relveant document ID.
Declaration
Swift
@objc public let oldDocument: DittoDocument?
-
The new representation of the document with the relveant document ID.
Declaration
Swift
@objc public let newDocument: DittoDocument?