You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ Vector is based primarily around three classes: `VectorViewModel`, `VectorState`
17
17
18
18
The Vector ViewModel class is the heart of any screen built with Vector. It is an abstract class extending the Android Architecture Components ViewModel class, and therefore survives configuration changes. It is generic on a class implementing the `VectorState` interface. It is also the only class which can mutate state.
19
19
20
-
It exposes the current state through a `LiveData` object.
20
+
It exposes the current state through a `Kotlin Flow`.
21
21
22
22
***VectorState**
23
23
@@ -53,11 +53,15 @@ class MyFragment: VectorFragment() {
overridefunrenderState = withState(myViewModel) { state ->
64
+
overridefunrenderer(state:MyState) {
61
65
messageTextView.text = state.message
62
66
}
63
67
}
@@ -82,10 +86,10 @@ class MyViewModel(initState: MyState): VectorViewModel<MyState>(initState) {
82
86
}
83
87
```
84
88
85
-
When the `setState()` function is given a state reducer, it internally enqueues it to a Kotlin `Channel`. The reducers passed to this channel are internally processed on a single background thread to avoid race conditions.
89
+
When the `setState()` function is given a state reducer, it internally enqueues it to a Kotlin `Actor`. The reducers passed to this actor are processed sequentially to avoid race conditions.
86
90
87
91
### Projects using Vector
88
-
* You can find a sample app along with the library in this repository.
92
+
* You can find a [sample app](https://github.com/haroldadmin/Vector/tree/master/sampleapp) along with the library in this repository.
89
93
*[MoonShot](https://www.github.com/haroldadmin/MoonShot) is another project of mine. It's an app to help you keep up with SpaceX launches, and is built with Vector.
90
94
91
95
If you would like your project using Vector to be featured here, please open an Issue on the repository. I shall take a look at it and add your project to the list.
0 commit comments