tie_fp 1.0.1 copy "tie_fp: ^1.0.1" to clipboard
tie_fp: ^1.0.1 copied to clipboard

Functional Opinionated library for Flutter

example/tie_fp_example.dart

import 'package:tie_fp/tie_fp.dart';

import 'utils.dart';

void main() async {
  Result<int> result = await performOperation();

  if (result.isError()) {
    print('An error occurred: ${result.getError()} ${result.stackTrace()}');
  } else {
    int value = result.getValue();
    print('Operation successful! Result: $value');
  }

  // final v = test().toResult();
}

Result tryCatchExample<T>() =>
    Result.wrapFunction(() => performOperationThatMayThrowException());

List<int> test() => List.generate(1, (index) => index);

Object performOperationThatMayThrowException() => throw UnimplementedError();
0
likes
130
points
174
downloads

Publisher

verified publisherunacorbatanegra.dev

Weekly Downloads

Functional Opinionated library for Flutter

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on tie_fp