{"id":20763463,"url":"https://github.com/openfl/swiftsuspenders","last_synced_at":"2026-02-11T00:02:05.837Z","repository":{"id":39675710,"uuid":"143365283","full_name":"openfl/swiftsuspenders","owner":"openfl","description":"Fast and light-weight IoC container for Haxe","archived":false,"fork":false,"pushed_at":"2025-01-02T17:15:31.000Z","size":179,"stargazers_count":5,"open_issues_count":1,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-09-21T00:40:39.745Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haxe","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/openfl.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,"zenodo":null}},"created_at":"2018-08-03T02:05:17.000Z","updated_at":"2025-04-25T03:03:12.000Z","dependencies_parsed_at":"2025-05-16T18:36:55.876Z","dependency_job_id":"f3e9e5b0-5568-4c75-a92a-0f153d1917ad","html_url":"https://github.com/openfl/swiftsuspenders","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/openfl/swiftsuspenders","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfl%2Fswiftsuspenders","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfl%2Fswiftsuspenders/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfl%2Fswiftsuspenders/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfl%2Fswiftsuspenders/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openfl","download_url":"https://codeload.github.com/openfl/swiftsuspenders/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfl%2Fswiftsuspenders/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29322733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T20:44:44.282Z","status":"ssl_error","status_checked_at":"2026-02-10T20:44:43.393Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-17T10:44:17.203Z","updated_at":"2026-02-11T00:02:05.805Z","avatar_url":"https://github.com/openfl.png","language":"Haxe","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Haxe SwiftSuspenders\n\nThis is a Haxe port of the AS3 popular dependencies injection library SwiftSuspenders. It's more or less a one for one translation with the added benefit of having a Macro (compile time) reflector, which drastically improves performance.\n\n## Features\n\n- Macro reflector, just make sure than any class that using `@inject` implements `DescribedType`\n- injection requests configurable using standardized metadata\n- can inject into vars, setters, methods and constructors\n- injection requests can be optional\n- mapping dependencies by class and, optionally, name\n- satisfying dependencies using value, class instance, singleton or custom providers\n- chaining multiple injectors to create modular dependency-mapping graphs much like inheritance works in OOP\n- defining local and shared scope for mappings, akin to public and private members of a class\n- defining soft mappings that only get used if no injector higher up in the inheritance chain can satisfy a dependency\n- support object live-cycle management (note: The latter part of that management, i.e. the destruction, is not yet implemented, but will be for 2.0 final)\n\n## API\n\n### Requests\n\nRequests, aka injection points, can be defined using the metadata tag `@inject` atop the var, setter or method to inject into. For constructor injection, no metadata is required.\n\nNamed injections can be defined using the syntax `@inject(\"name=injection name\")`. In this case, constructors have to have their metadata placed atop the class itself, not the constructor. This is a limitation of the Flex compiler.\n\nOptional injection requests can be defined using the syntax `@inject(\"optional=true\")`\n\n### Mappings\n\nThe API is expressed as a DSL to make very fine-grained configuration of each mapping easy and readable:\n\n\tconst injector : Injector = new Injector;\n\t\n\t//create a basic mapping:\n\tinjector.map(Sprite); //will instantiate a new Sprite for each request for Sprite\n\t\n\t//map to another class:\n\tinjector.map(Sprite).toType(BetterSprite); //will instantiate a new BetterSprite for each request for Sprite\n\t\n\t//map as a singleton:\n\tinjector.map(EventDispatcher).asSingleton(); //will lazily create an instance and return it for each consecutive request\n\t\n\t//map an interface to a singleton:\n\tinjector.map(IEventDispatcher).toSingleton(EventDispatcher);\n\n### Beta\n\nSo, that's it for now as far as documentation is concerned. The implementation, on the other hand, is very stable and shouldn't regress anything that used to work in 1.x, as long as the API changes are dealt with, of course.\n\nMore documentation will soon come here, in the github wiki and as asdocs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfl%2Fswiftsuspenders","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenfl%2Fswiftsuspenders","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfl%2Fswiftsuspenders/lists"}