create method

  1. @override
Future<void> create(
  1. T entity
)
override

Create a new entity.

Implementation

@override
Future<void> create(T entity) async {
  final existed = _storage[entity.userId]?.containsKey(entity.id) ?? false;
  _storage.putIfAbsent(entity.userId, () => {})[entity.id] = entity;
  _emit(entity.id, entity.userId, existed ? DatumOperationType.update : DatumOperationType.create, entity);
}