{"id":19793569,"url":"https://github.com/darky/glency","last_synced_at":"2025-05-01T02:30:44.171Z","repository":{"id":247253712,"uuid":"825401941","full_name":"darky/glency","owner":"darky","description":"Tiny Gleam dependency injection. Make IO functions unit tests friendly.","archived":true,"fork":false,"pushed_at":"2024-12-29T19:18:42.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-25T21:52:19.070Z","etag":null,"topics":["dependency","gleam","injection"],"latest_commit_sha":null,"homepage":"","language":"Gleam","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-07-07T17:03:25.000Z","updated_at":"2024-12-29T19:19:00.000Z","dependencies_parsed_at":"2024-07-18T02:04:28.046Z","dependency_job_id":null,"html_url":"https://github.com/darky/glency","commit_stats":null,"previous_names":["darky/glency"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fglency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fglency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fglency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fglency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darky","download_url":"https://codeload.github.com/darky/glency/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251812265,"owners_count":21647876,"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":["dependency","gleam","injection"],"created_at":"2024-11-12T07:10:25.703Z","updated_at":"2025-05-01T02:30:44.165Z","avatar_url":"https://github.com/darky.png","language":"Gleam","funding_links":[],"categories":[],"sub_categories":[],"readme":"# glency\n\n## Deprecated in favor [klubok-gleam](https://github.com/darky/klubok-gleam)\n\n[![Package Version](https://img.shields.io/hexpm/v/glency)](https://hex.pm/packages/glency)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/glency/)\n![Erlang-compatible](https://img.shields.io/badge/target-erlang-a2003e)\n![JavaScript-compatible](https://img.shields.io/badge/target-javascript-f1e05a)\n\nTiny Gleam dependency injection. Make IO functions unit tests friendly.\n\n```sh\ngleam add glency\n```\n\n```gleam\nimport glency\n\ntype Cat {\n  Cat(name: String, age: Int)\n}\n\npub fn main() {\n  glency.init_di() // Firstly init DI container on application startup\n\n  {\n    // Mock implementation of `fetch_cat`\n    use \u003c- glency.with_di(fetch_cat, fn(_cat_id) { Cat(\"Barsik\", 7) })\n    fetch_cat(1) // will avoid IO, returns Barsik cat\n  }\n}\n\npub fn fetch_cat(cat_id: Int) {\n  use \u003c- glency.di(fetch_cat, #(cat_id)) // Make IO function DI friendly\n  // Here production IO implementation of function\n}\n```\n\nFurther documentation can be found at \u003chttps://hexdocs.pm/glency\u003e.\n\n## Development\n\n```sh\ngleam run   # Run the project\ngleam test  # Run the tests\ngleam shell # Run an Erlang shell\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarky%2Fglency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarky%2Fglency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarky%2Fglency/lists"}