Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
chRyNaN committed Feb 14, 2022
1 parent f570c9b commit bca045f
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Android Parceling support for the [Kotlinx Serialization library](https://github
```kotlin
intent.putExtra("key", value, serializer)
val value = intent.getParcelableExtra("key", deserializer)

// Compose
rememberSavable(serializer) { value }
```

Now all the serialization can be handled from a single library, no need to create both custom Parcelers and Serializers.
Expand All @@ -32,8 +35,16 @@ repositories {

### Dependency

#### Core

```groovy
implementation "com.chrynan.parcelable:parcelable-core:$VERSION"
implementation("com.chrynan.parcelable:parcelable-core:$VERSION")
```

#### Compose

```kotlin
implementation("com.chrynan.parcelable:parcelable-compose:$VERSION")
```

## Usage
Expand Down Expand Up @@ -81,6 +92,12 @@ val myModel = parcelable.decodeFromParcel(parcel)
val myModel = parcelable.decodeFromBundle(bundle)
```

* Or serialize to a `Saver` with Jetpack Compose

```kotlin
val model = rememberSavable(parcelable = parcelable, serializer = MyModel.serializer) { myModel }
```

## Documentation

More detailed documentation is available in the [docs](docs) folder. The entry point to the documentation can be
Expand Down

0 comments on commit bca045f

Please sign in to comment.