Skip to content

Commit 740d3e7

Browse files
committed
Update doc
1 parent a84b749 commit 740d3e7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class MyViewModel(private val postRepository: PostRepository)
7979

8080
Finally, inside your view class (`Activity`, `Fragment` or similar) you can emit actions to your state machine and observe state changes.
8181

82-
If you want to use a [built in LiveData state observer](https://github.com/adrielcafe/HAL/blob/master/hal-livedata/src/main/kotlin/cafe/adriel/hal/livedata/observer/LiveDataStateObserver.kt), just pass your `LifecycleOwner` to `viewModel.observeState()`, otherwise HAL will use a default [callback-based state observer](https://github.com/adrielcafe/HAL/blob/master/hal-core/src/main/kotlin/cafe/adriel/hal/observer/CallbackStateObserver.kt) (which is best suited for JVM-only applications).
82+
If you want to use a [LiveData-based state observer](https://github.com/adrielcafe/HAL/blob/master/hal-livedata/src/main/kotlin/cafe/adriel/hal/livedata/observer/LiveDataStateObserver.kt), just pass your `LifecycleOwner` to `observeState()`, otherwise HAL will use a default [Callback-based state observer](https://github.com/adrielcafe/HAL/blob/master/hal-core/src/main/kotlin/cafe/adriel/hal/observer/CallbackStateObserver.kt) (which is best suited for JVM-only applications).
8383

8484
```kotlin
8585
class MyActivity : AppCompatActivity() {
@@ -111,11 +111,11 @@ class MyActivity : AppCompatActivity() {
111111

112112
### Custom StateObserver
113113

114-
If needed, you can easily create your custom state observers by just implementing the `StateObserver<State>` interface:
114+
If needed, you can easily create your custom state observers by implementing the `StateObserver<State>` interface:
115115

116116
```kotlin
117117
class MyCustomStateObserver<S : HAL.State>(
118-
private val myCustomParam: SomeCoolClass,
118+
private val myAwesomeParam: MyAwesomeClass,
119119
override val observer: (S) -> Unit
120120
) : StateObserver<S> {
121121

@@ -129,7 +129,7 @@ class MyCustomStateObserver<S : HAL.State>(
129129
And to use, just create an instance of it and pass to `observeState()` function:
130130

131131
```kotlin
132-
viewModel.observeState(MyCustomStateObserver(myCustomParam) { state ->
132+
viewModel.observeState(MyCustomStateObserver(myAwesomeParam) { state ->
133133
// Handle state
134134
})
135135
```

0 commit comments

Comments
 (0)