Skip to content
This repository has been archived by the owner on Mar 2, 2024. It is now read-only.

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cheonjaeung committed Jan 7, 2023
1 parent 464b9db commit d203a0c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# SavedState KTX

![maven-central](https://img.shields.io/maven-central/v/io.woong.savedstate/savedstate-ktx)
![android-sdk](https://img.shields.io/badge/android-21+-brightgreen?logo=android)
![kotlin-version](https://img.shields.io/badge/kotlin-1.7.20-blueviolet?logo=kotlin)
![maven-central](https://img.shields.io/maven-central/v/io.woong.savedstate/savedstate-ktx)
![license](https://img.shields.io/badge/license-MIT-blue)
[![test](https://github.com/cheonjaewoong/savedstate-ktx/actions/workflows/test.yaml/badge.svg)](https://github.com/cheonjaewoong/savedstate-ktx/actions/workflows/test.yaml)

Expand Down Expand Up @@ -70,6 +71,16 @@ class SampleViewModel(savedStateHandle: SavedStateHandle) : ViewModel() {

Like delegated livedata, you can use delegated stateflow like this.

```kotlin
class SampleViewModel(savedStateHandle: SavedStateHandle) : ViewModel() {
@OptIn(ExperimentalSavedStateKtxApi::class)
val stateFlow: MutableStateFlow<String> by savedStateHandle.mutableStateFlow("init")
}
```

Delegated mutable stateflow is currently experimental feature.
You can use like above sample.

## License

SavedState KTX is published under the [MIT License](./LICENSE.txt).
SavedState KTX is under the [MIT License](./LICENSE.txt).

0 comments on commit d203a0c

Please sign in to comment.