{"id":21567438,"url":"https://github.com/hpopp/returnable","last_synced_at":"2025-03-18T05:40:50.458Z","repository":{"id":94312122,"uuid":"128155740","full_name":"hpopp/returnable","owner":"hpopp","description":"Return statement for Elixir","archived":false,"fork":false,"pushed_at":"2018-04-05T14:44:01.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-24T12:23:57.641Z","etag":null,"topics":["elixir","elixir-lang"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/hpopp.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-05T03:44:07.000Z","updated_at":"2023-06-28T19:17:50.000Z","dependencies_parsed_at":"2023-03-14T19:01:24.321Z","dependency_job_id":null,"html_url":"https://github.com/hpopp/returnable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpopp%2Freturnable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpopp%2Freturnable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpopp%2Freturnable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpopp%2Freturnable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hpopp","download_url":"https://codeload.github.com/hpopp/returnable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244166637,"owners_count":20409177,"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":["elixir","elixir-lang"],"created_at":"2024-11-24T10:30:55.051Z","updated_at":"2025-03-18T05:40:50.437Z","avatar_url":"https://github.com/hpopp.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Returnable\n\nReturn statement for Elixir.\n\n\u003e This package is written by professionals. Don't try this at home.\n\n## Installation\n\nAdd `returnable` to your list of dependencies in `mix.exs` if you don't like your team:\n\n```elixir\ndef deps do\n  [\n    {:returnable, github: \"hpopp/returnable\"}\n  ]\nend\n```\n\n## Quickstart Example\nAdd `use Returnable` to your module and define returnable functions with `defr`. It's so easy to get started you'll feel dumber for using it.\n\n```elixir\ndefmodule YourModule do\n  use Returnable\n  \n  defr sample_fun(x) do\n    if x == 5 do\n      return :awesome\n    end\n    \n    x + 5\n  end\nend\n\niex\u003e YourModule.sample_fun(5)\n:awesome\niex\u003e YourModule.sample_fun(7)\n12\n```\n\nThis package allows you to write really terrible code like:\n\n```elixir\ndefr fetch_active_user(id) do\n  if User.admin?(id) do\n    return Admin.fetch(id)\n  else\n    if User.active?(id) do\n      return User.fetch(id)\n    end\n  end\n  return nil # Not necessary, but probably makes you feel warm and fuzzy\nend\n```\n\nHaving trouble with `Enum` functions? No worries, you don't need to understand them anymore.\n\n```elixir\ndefr fetch_user(users, id) do\n  for user \u003c- users do\n    if user.id == id, do: return user\n  end\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpopp%2Freturnable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhpopp%2Freturnable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpopp%2Freturnable/lists"}