https://github.com/devxoul/pureswinject
Auto register Pure factories to Swinject
https://github.com/devxoul/pureswinject
Last synced: 3 months ago
JSON representation
Auto register Pure factories to Swinject
- Host: GitHub
- URL: https://github.com/devxoul/pureswinject
- Owner: devxoul
- License: mit
- Created: 2020-09-24T14:59:09.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-09T08:07:40.000Z (over 4 years ago)
- Last Synced: 2025-04-09T07:17:34.280Z (3 months ago)
- Language: Swift
- Size: 23.4 KB
- Stars: 19
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PureSwinject
Auto register Pure factories to Swinject
## Usage
**Before**
```swift
container.register(MyModule.Factory.self) { r in
MyModule.Factory(dependency: .init(
foo: r.resolve(Foo.self)!,
bar: r.resolve(Bar.self)!
))
}
```**After**
```swift
container.autoregister(MyModule.Factory.self, dependency: MyModule.Dependency.init)
```## License
PureSwinject is under MIT license. See the [LICENSE](LICENSE) file for more info.