https://github.com/artemmey/kotlin-delegate-concatenator
https://github.com/artemmey/kotlin-delegate-concatenator
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/artemmey/kotlin-delegate-concatenator
- Owner: ArTemmey
- Created: 2020-09-14T16:07:03.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-17T17:53:14.000Z (about 5 years ago)
- Last Synced: 2025-02-17T11:32:10.183Z (8 months ago)
- Language: Kotlin
- Size: 57.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Kotlin library for concatenating delegates.
# Installation
In your root `build.gradle`:
```gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
In your `app/build.gradle`:
```gradle
dependencies {
implementation 'com.github.ArtemiyDmtrvch.kotlin-delegate-concatenator:kotlin-delegate-concatenator:+'
}
```# Usage
```kotlin
var multiDelegatedVar by delegate1(initialValue) + delegate2(initialValue)
```
`multiDelegatedVar` will be delegated by the class returned by the `+` method. In the `getValue` method this class will take the value from `delegate1` and in the `setValue` method it will cause setting the value in `delegate1` and in `delegate2`.