{"id":25234134,"url":"https://github.com/elias8/outcome","last_synced_at":"2025-04-05T17:15:05.797Z","repository":{"id":189783802,"uuid":"681309774","full_name":"elias8/outcome","owner":"elias8","description":"A dart library that provides a functional approach to error handling.","archived":false,"fork":false,"pushed_at":"2023-08-21T19:00:07.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T13:58:40.110Z","etag":null,"topics":["dart","either-monad","flutter","functional-programming"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/outcome","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elias8.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-21T18:24:59.000Z","updated_at":"2024-11-02T12:09:04.000Z","dependencies_parsed_at":"2023-08-21T19:23:44.041Z","dependency_job_id":"a4216ff0-ef3e-4945-a87a-bb5bef10f8a1","html_url":"https://github.com/elias8/outcome","commit_stats":null,"previous_names":["elias8/outcome"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias8%2Foutcome","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias8%2Foutcome/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias8%2Foutcome/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias8%2Foutcome/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elias8","download_url":"https://codeload.github.com/elias8/outcome/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369948,"owners_count":20927928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","either-monad","flutter","functional-programming"],"created_at":"2025-02-11T13:58:43.820Z","updated_at":"2025-04-05T17:15:05.768Z","avatar_url":"https://github.com/elias8.png","language":"Dart","readme":"# outcome\n\n[![pub package](https://img.shields.io/pub/v/outcome.svg)](https://pub.dartlang.org/packages/outcome)\n\nA dart library that provides a functional approach to error handling.\n\n## Installation\n\nAdd the following dependencies to your project.\n\n```yaml\ndependencies:\n  outcome: ^0.0.1\n```\n\n## Usage\n\n```dart\nimport 'package:outcome/outcome.dart';\n\nvoid main() {\n  final result = divide(10, 2);\n  result.fold(\n        (error) =\u003e print('Error is $error'),\n        (value) =\u003e print('Result is $value'),\n  );\n}\n\n/// Returns the result of dividing [a] by [b]. If [b] is 0, returns an [Error].\nEither\u003cError, int\u003e divide(int a, int b) {\n  if (b == 0) {\n    return Left(Error.divisionByZero);\n  } else {\n    return Right(a ~/ b);\n  }\n}\n\n/// An error that can occur when dividing two numbers.\nenum Error {\n  /// Occurs when the divisor is 0.\n  divisionByZero,\n}\n```\n\n## Maintainer\n- [Elias Andualem](https://github.com/elias8)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felias8%2Foutcome","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felias8%2Foutcome","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felias8%2Foutcome/lists"}