refineAsync method

S refineAsync(
  1. Future<bool> check(
    1. O value
    ), {
  2. String? message,
  3. String code = 'custom',
  4. List<Object> path = const <Object>[],
})

Add an async one-off check, like "email is unique". Use parseAsync with it.

Implementation

S refineAsync(
  Future<bool> Function(O value) check, {
  String? message,
  String code = 'custom',
  List<Object> path = const <Object>[],
}) {
  return use(
    RefineRule<O>(
      asyncCheck: check,
      message: message,
      code: code,
      extraPath: path,
    ),
  );
}