Skip to content

Commit 47e4d54

Browse files
Patrick Jacksonpatjackson52
authored andcommitted
update references to createStore to createThreadSafeStore
1 parent 093d26c commit 47e4d54

File tree

16 files changed

+22
-19
lines changed

16 files changed

+22
-19
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Using a function:
9999
}
100100
```
101101

102-
Using the convinence helper function `middleware`:
102+
Using the convenience helper function `middleware`:
103103
```
104104
val loggingMiddleware = middleware { store, next, action ->
105105
//log here
@@ -109,7 +109,7 @@ Using the convinence helper function `middleware`:
109109

110110
__Create a store__
111111
```
112-
val store = createStore(reducer, AppState(user, listOf()), applyMiddleware(loggingMiddleware))
112+
val store = createThreadSafeStore(reducer, AppState(user, listOf()), applyMiddleware(loggingMiddleware))
113113
```
114114

115115
You then will have access to dispatch and subscribe functions from the `store`.

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ allprojects {
2525
jcenter()
2626
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
2727
maven { url "https://dl.bintray.com/spekframework/spek-dev" }
28+
mavenCentral()
2829
}
2930

3031
group = GROUP

examples/counter/android/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ dependencies {
4040
implementation(Libs.appcompat)
4141

4242
implementation(project(":examples:counter:common"))
43-
implementation(project(":lib"))
43+
implementation(project(":lib-threadsafe"))
4444
}

examples/counter/android/src/main/java/org/reduxkotlin/example/counter/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import android.os.Handler
55
import androidx.appcompat.app.AppCompatActivity
66
import kotlinx.android.synthetic.main.activity_main.*
77
import org.reduxkotlin.StoreSubscription
8-
import org.reduxkotlin.createStore
8+
import org.reduxkotlin.createThreadSafeStore
99
import org.reduxkotlin.examples.counter.Decrement
1010
import org.reduxkotlin.examples.counter.Increment
1111
import org.reduxkotlin.examples.counter.reducer
@@ -16,7 +16,7 @@ import org.reduxkotlin.examples.counter.reducer
1616
*/
1717

1818

19-
val store = createStore(reducer, 0)
19+
val store = createThreadSafeStore(reducer, 0)
2020

2121
class MainActivity: AppCompatActivity() {
2222
lateinit var storeSubscription: StoreSubscription

examples/todos/android/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ dependencies {
4343
implementation(Libs.recyclerView)
4444

4545
implementation(project(":examples:todos:common"))
46-
implementation(project(":lib"))
46+
implementation(project(":lib-threadsafe"))
4747
}

examples/todos/android/src/main/java/org/reduxkotlin/example/todos/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import android.os.Bundle
44
import androidx.appcompat.app.AppCompatActivity
55
import kotlinx.android.synthetic.main.activity_main.*
66
import org.reduxkotlin.StoreSubscription
7-
import org.reduxkotlin.createStore
7+
import org.reduxkotlin.createThreadSafeStore
88
import org.reduxkotlin.examples.todos.*
99

1010
/**
@@ -13,7 +13,7 @@ import org.reduxkotlin.examples.todos.*
1313
*/
1414

1515

16-
val store = createStore(::rootReducer, AppState())
16+
val store = createThreadSafeStore(::rootReducer, AppState())
1717

1818
class MainActivity: AppCompatActivity() {
1919
private lateinit var storeSubscription: StoreSubscription

examples/todos/common/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ kotlin {
3232
commonMain {
3333
dependencies {
3434
implementation kotlin("stdlib-common")
35-
implementation project(":lib")
35+
implementation project(":lib-threadsafe")
3636
}
3737
}
3838
commonTest {

lib/src/commonMain/kotlin/org/reduxkotlin/Definitions.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ fun <State> middleware(dispatch: (Store<State>, next: Dispatcher, action: Any) -
8484
*
8585
* val rootReducer = combineReducers(loginReducer, feedReducer)
8686
* val store = createStore(rootReducer, AppState())
87+
* **or**
88+
* val store = createThreadSafeStore(rootReducer, AppState())
8789
*/
8890
inline fun <TState, reified TAction> reducerForActionType(
8991
crossinline reducer: ReducerForActionType<TState, TAction>

website/docs/advanced/Middleware.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fun createThunkMiddleware(extraArgument: Any? = null): ThunkMiddleware =
8484
}
8585
}
8686

87-
val store = createStore(
87+
val store = createThreadSafeStore(
8888
reducer,
8989
applyMiddleware(
9090
createThunkMiddleware(),

website/docs/api/Store.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ perform side effects, or chain them to execute in a sequence, see the examples f
105105
#### Example
106106

107107
```kotlin
108-
val store = createStore(todos, AppState(list = listOf("Use Redux")))
108+
val store = createThreadSafeStore(todos, AppState(list = listOf("Use Redux")))
109109

110110
data class AddTodo(
111111
val text: String

0 commit comments

Comments
 (0)