Set.fromResult constructor

Set.fromResult(
  1. Object result
)

fromResult

Implementation

factory Set.fromResult(Object result) {
  if (result is RespType2<dynamic>) {
    return result.handleAs<Set>(
      simple: (_) => Set(ok: true, oldVal: null),
      bulk: (type) => Set(ok: type.payload != null, oldVal: type.payload),
      error: (_) => Set(ok: false, oldVal: null),
    );
  }

  return (result as RespType3<dynamic>).handleAs<Set>(
    simple: (_) => Set(ok: true, oldVal: null),
    bulk: (type) => Set(ok: type.payload != null, oldVal: type.payload),
    error: (_) => Set(ok: false, oldVal: null),
  );
}