https://github.com/danysantiago/hilt-install-binding
https://github.com/danysantiago/hilt-install-binding
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/danysantiago/hilt-install-binding
- Owner: danysantiago
- License: apache-2.0
- Created: 2020-09-14T02:00:23.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-27T15:20:44.000Z (over 4 years ago)
- Last Synced: 2025-03-28T03:12:34.849Z (7 months ago)
- Language: Kotlin
- Size: 91.8 KB
- Stars: 58
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Hilt Install Binding Extension
A Hilt extension that reduces a bit of boilerplate for single implementation bindings.
Example usage:
```kotlin
@InstallBinding(SingletonComponent::class)
class AuthenticatorImpl @Inject constructor(): Authenticator
```
the above example is equivalent to:
```kotlin
@Module
@InstallIn(SingletonComponent::class)
interface BindAuthModule {
@Binds
fun bind(impl: AuthenticatorImpl): Authenticator
}
```## Disclaimer
This is **not** an official Google product.