autoIdentify method

  1. @override
IdentifiedObject<T> autoIdentify(
  1. T object, {
  2. T updateObjectWithId(
    1. T object,
    2. String id
    )?,
})
override

Generates a unique ID for an object and returns an IdentifiedObject.

If updateObjectWithId is provided, the object is updated with the generated ID. If not provided, the object remains unchanged.

Implementation

@override
IdentifiedObject<T> autoIdentify(
  T object, {
  T Function(T object, String id)? updateObjectWithId,
}) {
  return FirestoreIdentifiedObject(
    object,
    updateObjectWithId ?? (object, id) => object,
    this,
  );
}