Skip to content

Commit

Permalink
Fix typo in threading.md (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
nateridderman authored Sep 8, 2023
1 parent 87d7450 commit dacb1e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/threading.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fun setAndRetrieveState() {
```
This would print: [A, C, E, B, D]

You can view some more complex ordering situations [here](https://github.com/airbnb/mavericks/blob/release/2.0.0/mvrx/src/test/kotlin/com/airbnb/mvrx/SetStateWithStateOrderingTest.kt). However, most of the time it will be have as you would expect and you don't have to think about the threading model.
You can view some more complex ordering situations [here](https://github.com/airbnb/mavericks/blob/release/2.0.0/mvrx/src/test/kotlin/com/airbnb/mvrx/SetStateWithStateOrderingTest.kt). However, most of the time it will behave as you would expect and you don't have to think about the threading model.

However, it is sometimes necessary to get data synchronously for views so as a convenience, `withState` _is_ run synchronously when called from outside of the ViewModel.
```kotlin
Expand All @@ -40,4 +40,4 @@ fun invalidate() = withState(viewModel) { state ->
}
```

By default Mavericks creates a shared dispatcher for processing `withState`/`setState` queue. You can set your own dispatcher (e.g. `Dispatchers.Default`) by injecting it into `MavericksViewModelConfigFactory.storeContextOverride`
By default Mavericks creates a shared dispatcher for processing `withState`/`setState` queue. You can set your own dispatcher (e.g. `Dispatchers.Default`) by injecting it into `MavericksViewModelConfigFactory.storeContextOverride`

0 comments on commit dacb1e7

Please sign in to comment.