Ditto 5.0.0
Loading...
Searching...
No Matches
DittoSDK.Store.DittoDiffer Class Reference

Calculates diffs between lists of DittoQueryResultItem. More...

Inheritance diagram for DittoSDK.Store.DittoDiffer:
DittoSDK.Internal.Drop

Public Member Functions

 DittoDiffer ()
 Initializes a new instance of the DittoDiffer class.
DittoDiff Diff (List< DittoQueryResultItem > items)
 Calculate the diff of the provided items against the last set of items that were passed to this differ.
Public Member Functions inherited from DittoSDK.Internal.Drop
void Dispose ()
 Suppresses finalization and initiates custom disposal logic.

Protected Member Functions

override void Dispose (bool disposing)
Protected Member Functions inherited from DittoSDK.Internal.Drop
void Dispose (bool disposing)
 Overload for types to dispose of resources, regardless of whether the type is being disposed or finalized. Note that finalization occurs on a dedicated thread.

Additional Inherited Members

Properties inherited from DittoSDK.Internal.Drop
bool IsDisposed [get]

Detailed Description

Calculates diffs between lists of DittoQueryResultItem.

Use a DittoDiffer with a DittoStoreObserver to get the diff between subsequent query results delivered by the store observer.

Member Function Documentation

◆ Diff()

DittoDiff DittoSDK.Store.DittoDiffer.Diff ( List< DittoQueryResultItem > items)
inline

Calculate the diff of the provided items against the last set of items that were passed to this differ.

The returned DittoDiff identifies changes from the old list of items to the new list of items using indices into both lists.

Initially, the Differ has no items, so the first call to this method will always return a diff showing all items as insertions.

The identity of items is determined by their "_id" field.

Parameters
itemsThe query result items to compare against the last list of items.
Returns
A DittoDiff describing the changes.