{"id":13744002,"url":"https://github.com/tschneidereit/SwiftSuspenders","last_synced_at":"2025-05-09T02:32:11.180Z","repository":{"id":665541,"uuid":"308649","full_name":"tschneidereit/SwiftSuspenders","owner":"tschneidereit","description":"  NOTE: Find the offical repo at http://github.com/robotlegs/swiftsuspenders","archived":true,"fork":false,"pushed_at":"2013-03-22T00:52:32.000Z","size":3182,"stargazers_count":281,"open_issues_count":10,"forks_count":89,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-11-15T15:41:47.167Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/robotlegs/swiftsuspenders","language":"ActionScript","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/tschneidereit.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}},"created_at":"2009-09-16T08:46:16.000Z","updated_at":"2024-11-05T23:22:03.000Z","dependencies_parsed_at":"2022-07-07T18:40:19.556Z","dependency_job_id":null,"html_url":"https://github.com/tschneidereit/SwiftSuspenders","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tschneidereit%2FSwiftSuspenders","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tschneidereit%2FSwiftSuspenders/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tschneidereit%2FSwiftSuspenders/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tschneidereit%2FSwiftSuspenders/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tschneidereit","download_url":"https://codeload.github.com/tschneidereit/SwiftSuspenders/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253177775,"owners_count":21866400,"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":[],"created_at":"2024-08-03T05:01:01.201Z","updated_at":"2025-05-09T02:32:10.794Z","avatar_url":"https://github.com/tschneidereit.png","language":"ActionScript","funding_links":[],"categories":["ActionScript","Frameworks"],"sub_categories":["RobotLegs Framework"],"readme":"# SwiftSuspenders\n\nAttention: This README is just a stub to prevent you from reading the heavily outdated [one for Swiftsuspenders 1.x](https://github.com/tschneidereit/SwiftSuspenders/blob/the-past/README.textile).\n\nThat being said, here's a very quick outline of the new version's capabilities and API:\n\n## Features\n\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.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftschneidereit%2FSwiftSuspenders","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftschneidereit%2FSwiftSuspenders","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftschneidereit%2FSwiftSuspenders/lists"}