Skip to content

Commit 093d26c

Browse files
Patrick Jacksonpatjackson52
Patrick Jackson
authored andcommitted
bump to 0.5.1, update docs
1 parent 5e30766 commit 093d26c

13 files changed

+40
-19
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Unreleased
22

3+
## [0.5.0] - 2020-06-11
4+
- update lib dependency to api import, so core lib is included in redux-kotlin-threadsafe
35
## [0.5.0] - 2020-06-11
46
- kotlin 1.3.72
57
- createThreadSafeStore fun added for thread synchronized access

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ kotlin {
4444
sourceSets {
4545
commonMain { // <--- name may vary on your project
4646
dependencies {
47-
implementation "org.reduxkotlin:redux-kotlin-threadsafe:0.5.0"
47+
implementation "org.reduxkotlin:redux-kotlin-threadsafe:0.5.1"
4848
}
4949
}
5050
}
5151
```
5252

5353
For JVM only:
5454
```
55-
implementation "org.reduxkotlin:redux-kotlin-threadsafe-jvm:0.5.0"
55+
implementation "org.reduxkotlin:redux-kotlin-threadsafe-jvm:0.5.1"
5656
```
5757

5858
*Non threadsafe store is available. Typical usage will be with the threadsafe store. [More info read here](https://www.reduxkotlin.org/introduction/getting-started)

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ android.enableJetifier=true
2121
kotlin.code.style=official
2222

2323
GROUP=org.reduxkotlin.redux-kotlin
24-
VERSION_NAME=0.5.0
24+
VERSION_NAME=0.5.1
2525

2626
POM_ARTIFACT_ID=reduxkotlin
2727
POM_DESCRIPTION=Redux implementation for Kotlin. Mulitiplatform supported.

lib-threadsafe/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ apply plugin: 'kotlinx-atomicfu'
88
archivesBaseName = 'redux-kotlin-threadsafe'
99

1010
group 'org.reduxkotlin'
11-
version '0.5.0'
11+
version '0.5.1'
1212

1313
kotlin {
1414
jvm()

lib/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ apply plugin: 'kotlin-multiplatform'
77
archivesBaseName = 'redux-kotlin'
88

99
group 'org.reduxkotlin'
10-
version '0.5.0'
10+
version '0.5.1'
1111

1212
kotlin {
1313
jvm()

website/.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.now
1+
.now
2+
.vercel

website/docs/api/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ data class Store<State>(
7474
### Top-Level Functions
7575

7676
- [createStore(reducer: Reducer, preloadedState: State, enhancer: StoreEnhancer)](createStore.md)
77+
- [createThreadSafeStore(reducer: Reducer, preloadedState: State, enhancer: StoreEnhancer)](createThreadSafeStore.md)
7778
- [applyMiddleware(...middlewares)](applyMiddleware.md)
7879
- [compose(...functions)](compose.md)
7980

website/docs/api/createSameThreadEnforcedStore.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
id: createSameThreadEnforcedstore
2+
id: createsamethreadenforcedstore
33
title: createSameThreadEnforcedStore
44
sidebar_label: createSameThreadEnforcedStore
55
hide_title: true
66
---
77

8-
# `createSameThreadEnforcedStore(reducer, preloadedState, enhancer)
8+
# `createSameThreadEnforcedStore(reducer, preloadedState, enhancer)`
99

1010
Creates a Redux [store](Store.md) that can only be accessed from the same thread.
1111
Any call to the store's functions called from a thread other than thread from which

website/docs/api/createThreadSafeStore.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
id: createThreadSafeStore
2+
id: createthreadsafestore
33
title: createThreadSafeStore
44
sidebar_label: createThreadSafeStore
55
hide_title: true
66
---
77

8-
# `createThreadSafeStore(reducer, preloadedState, enhancer)
8+
# `createThreadSafeStore(reducer, preloadedState, enhancer)`
99

1010
Creates a Redux [store](Store.md) that is may be accessed from any thread.
1111

website/docs/introduction/GettingStarted.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ kotlin {
3333
sourceSets {
3434
commonMain {
3535
dependencies {
36-
implementation "org.reduxkotlin:redux-kotlin-threadsafe:0.5.0"
36+
implementation "org.reduxkotlin:redux-kotlin-threadsafe:0.5.1"
3737
}
3838
}
3939
}
@@ -47,11 +47,11 @@ __For single platform project (i.e. just Android):__
4747

4848
```groovy
4949
dependencies {
50-
implementation "org.reduxkotlin:redux-kotlin-threadsafe-jvm:0.5.0"
50+
implementation "org.reduxkotlin:redux-kotlin-threadsafe-jvm:0.5.1"
5151
}
5252
```
5353

54-
NOTE: If threadsafety is not a concern (i.e. a JS only project) "org.reduxkotlin:redux-kotlin:0.5.0" may be used.
54+
NOTE: If threadsafety is not a concern (i.e. a JS only project) "org.reduxkotlin:redux-kotlin:0.5.1" may be used.
5555
[**More info on threading available here.**](/introduction/threading)
5656

5757
## Basic Example

website/docs/introduction/Threading.md

+13-6
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,20 @@ state. Or 2 actions dispatched concurrently could cause an invalid state.
1919

2020
**So you there are 3 options:**
2121

22-
1) Synchronize access to the store - [createThreadSafeStore()](../api/createThreadSafeStore.md)
23-
2) Only access the store from the same thread - [createSameThreadEnforcedStore()](../api/createSameThreadEnforcedStore.md)
24-
3) Live in the wild west and access store anytime, any thread and live with consequences - NOT RECOMMENDED - [createStore()](../api/createStore.md)
22+
1) Synchronize access to the store - [createThreadSafeStore()](../api/createThreadSafeStore.md)
23+
2) Only access the store from the same thread - [createSameThreadEnforcedStore()](../api/createSameThreadEnforcedStore.md)
24+
3) Live in the wild west and access store anytime, any thread
25+
and live with consequences - NOT_RECOMMENDED - [createStore()](../api/createStore.md)
2526

2627
ReduxKotlin allows all these, but most cases will fall into #1.
2728

29+
## ThreadSafe
30+
2831
Starting with ReduxKotlin 0.5.0 there is a threadsafe store which uses synchronization (AtomicFu library)
2932
to allow safe access to all the functions on the store. This is the recommended usage for 90% of use cases.
3033

3134
```kotlin
32-
val store = createThreadSafeStore(...)
35+
val store = createThreadSafeStore(reducer, state)
3336
```
3437

3538
Who is the other 10%? If you are only targeting Javascript thread safety is not an issue, so
@@ -55,9 +58,13 @@ have do not have the enforcement in place yet.
5558

5659
To use `same thread enforcement`:
5760
```kotlin
58-
val store = createSameThreadEnforcedStore(...)
61+
val store = createSameThreadEnforcedStore(reducer, state)
5962
```
6063

64+
## Wild west - no enforcement
65+
66+
`createStore()` may be used if the project is only a single threaded application (i.e. JS only), or you
67+
just want control access within your codebase(NOT_RECOMMENDED).
6168

6269
***IF*** you are using vanilla `createStore()`, then you may use an different artifact,
6370
and avoid pulling in AtomicFu dependency:
@@ -67,7 +74,7 @@ kotlin {
6774
sourceSets {
6875
commonMain {
6976
dependencies {
70-
implementation "org.reduxkotlin:redux-kotlin:0.5.0"
77+
implementation "org.reduxkotlin:redux-kotlin:0.5.1"
7178
}
7279
}
7380
}

website/i18n/en.json

+8
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,18 @@
2929
"title": "compose",
3030
"sidebar_label": "compose"
3131
},
32+
"api/createsamethreadenforcedstore": {
33+
"title": "createSameThreadEnforcedStore",
34+
"sidebar_label": "createSameThreadEnforcedStore"
35+
},
3236
"api/createstore": {
3337
"title": "createStore",
3438
"sidebar_label": "createStore"
3539
},
40+
"api/createthreadsafestore": {
41+
"title": "createThreadSafeStore",
42+
"sidebar_label": "createThreadSafeStore"
43+
},
3644
"api/api-reference": {
3745
"title": "API Reference",
3846
"sidebar_label": "API Reference"

website/sidebars.json

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
"API Reference": [
4646
"api/api-reference",
4747
"api/createstore",
48+
"api/createthreadsafestore",
49+
"api/createsamethreadenforcedstore",
4850
"api/store",
4951
"api/combinereducers",
5052
"api/applymiddleware",

0 commit comments

Comments
 (0)