perform method

  1. @override
Future<void> perform()
override

This function implements the logic of the mutation. It can return any value. If it is a Future it will be awaited. If it is VxEffects object, result will be piped to its VxEffects.fork call.

Implementation

@override
Future<void> perform() async {
  try {
    final data = await store?.onAddRequest?.call(request);
    if (data == null) {
      throw Exception('Request not added');
    }
    store?.requests = [data, ...?store?.requests];
  } catch (e) {
    rethrow;
  }
}