createSnapshot method

  1. @protected
Future<void> createSnapshot()
inherited

Create a snapshot of current state Override to provide custom snapshot logic

Implementation

@protected
Future<void> createSnapshot() async {
  final state = await getSnapshotState();
  if (state != null) {
    await _eventStore.saveSnapshot(_persistenceId, state, _sequenceNumber);
    await onSnapshotCreated(state, _sequenceNumber);
  }
}