Skip to content

Commit 5ef8a0b

Browse files
committed
address PR comments
1 parent ce28677 commit 5ef8a0b

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed

docs/FAQ.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,12 @@ hide_title: true
2424
- [Can or should I create multiple stores? Can I import my store directly, and use it in components myself?](faq/StoreSetup.md#can-or-should-i-create-multiple-stores-can-i-import-my-store-directly-and-use-it-in-components-myself)
2525
- [Is it OK to have more than one middleware chain in my store enhancer? What is the difference between next and dispatch in a middleware function?](faq/StoreSetup.md#is-it-ok-to-have-more-than-one-middleware-chain-in-my-store-enhancer-what-is-the-difference-between-next-and-dispatch-in-a-middleware-function)
2626
- [How do I subscribe to only a portion of the state? Can I get the dispatched action as part of the subscription?](faq/StoreSetup.md#how-do-i-subscribe-to-only-a-portion-of-the-state-can-i-get-the-dispatched-action-as-part-of-the-subscription)
27-
- **Actions**
28-
- [Why should type be a string, or at least serializable? Why should my action types be constants?](faq/Actions.md#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)
29-
- [Is there always a one-to-one mapping between reducers and actions?](faq/Actions.md#is-there-always-a-one-to-one-mapping-between-reducers-and-actions)
30-
- [How can I represent “side effects” such as AJAX calls? Why do we need things like “action creators”, “thunks”, and “middleware” to do async behavior?](faq/Actions.md#how-can-i-represent-side-effects-such-as-ajax-calls-why-do-we-need-things-like-action-creators-thunks-and-middleware-to-do-async-behavior)
31-
- [What async middleware should I use? How do you decide between thunks, sagas, observables, or something else?](faq/Actions.md#what-async-middleware-should-i-use-how-do-you-decide-between-thunks-sagas-observables-or-something-else)
32-
- [Should I dispatch multiple actions in a row from one action creator?](faq/Actions.md#should-i-dispatch-multiple-actions-in-a-row-from-one-action-creator)
33-
- **Immutable Data**
34-
- [What are the benefits of immutability?](faq/ImmutableData.md#what-are-the-benefits-of-immutability)
35-
- [Why is immutability required by Redux?](faq/ImmutableData.md#why-is-immutability-required-by-redux)
36-
- **Design Decisions**
37-
- [Why doesn't Redux pass the state and action to subscribers?](faq/DesignDecisions.md#why-doesnt-redux-pass-the-state-and-action-to-subscribers)
38-
- [Why doesn't Redux support using classes for actions and reducers?](faq/DesignDecisions.md#why-doesnt-redux-support-using-classes-for-actions-and-reducers)
39-
- [Why does the middleware signature use currying?](faq/DesignDecisions.md#why-does-the-middleware-signature-use-currying)
40-
- [Why does applyMiddleware use a closure for dispatch?](faq/DesignDecisions.md#why-does-applymiddleware-use-a-closure-for-dispatch)
41-
- **Miscellaneous**
42-
- [Are there any larger, “real” Redux projects?](faq/Miscellaneous.md#are-there-any-larger-real-redux-projects)
27+
- **Multiplatform**
28+
- [What is "Multiplatform" Kotlin?](faq/Multiplatform.md#what-is-multiplatform-kotlin)
29+
- [Can I use existing JS Redux code?](faq/Multiplatform.md#can-i-use-existing-js-redux-code)
30+
- [Can I use React with ReduxKotlin?](faq/Multiplatform.md#can-i-use-react-with-reduxkotlin)
31+
- [Does compiling to Native for iOS include a VM? Is there a lot of overhead?](faq/Multiplatform.md#does-compiling-to-native-for-ios-include-a-vm-is-there-a-lot-of-overhead)
32+
- [How do I structure a multiplatform kotlin project?](faq/Multiplatform.md#how-do-i-structure-a-multiplatform-kotlin-project)
33+
- [How is this related to the kotlin-redux wrapper?](faq/Multiplatform.md#how-is-this-related-to-the-kotlin-redux-wrapper)
34+
- [Are coroutines usable on Native/iOS?](faq/Multiplatform.md#are-coroutines-usable-on-native-ios)
35+

docs/Glossary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ These are possible with ReduxKotlin, but not yet documented and may required add
7272

7373
Reducers are the most important concept in Redux.
7474

75-
> ### Note about threading
75+
> #### Note about threading
7676
> Reducers should always be ran on the same thread. This is to avoid any
7777
> race conditions with actions being processed. Which thread is used is up
7878
> to you and your team. Main thread has traditionally been used without any problems,

docs/faq/Multiplatform.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ hide_title: true
1616

1717
## Multiplatform
1818

19-
### What is "Multiplatform" Kotlin
19+
### What is "Multiplatform" Kotlin?
2020

2121
Multiplatform Kotlin is the ability to compile Kotlin code to different targets. Available targets
2222
are JVM, Native (iOS, WIN, Linux), Javascript, & Webassembly. This allows writing business logic,

docs/introduction/GettingStarted.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ val store = createStore(reducer, 0)
9595
// You can use subscribe() to update the UI in response to state changes.
9696
// Normally you'd use an additional layer or view binding library rather than subscribe() directly.
9797

98-
store.subscribe { logger.debug(store.state)}
98+
val unsubscribe = store.subscribe { logger.debug(store.state)}
9999

100100
// The only way to mutate the internal state is to dispatch an action.
101101
// The actions can be serialized, logged or stored.
@@ -105,6 +105,11 @@ store.dispatch(Increment())
105105
// Current State: 2
106106
store.dispatch(Decrement())
107107
// Current State: 1
108+
109+
//Removes the reference to the subscription functions.
110+
//Must be called when subscription is no longer needed to avoid a
111+
//memory leak.
112+
unsubscribe()
108113
```
109114

110115
Instead of mutating the state directly, you specify the mutations you want to happen with plain
@@ -123,7 +128,7 @@ and reproduce them just by replaying every action.
123128

124129
## Examples
125130

126-
The ReduxKotlin Github contains several example projects demonstrating various aspects of how to use ReduxKotlin.
131+
The ReduxKotlin Github organization contains several example projects demonstrating various aspects of how to use ReduxKotlin.
127132

128133
- [**Counter**](/introduction/examples#counter): [Source](https://github.com/reduxkotlin/redux-kotlin/tree/master/examples/counter)
129134
- [**Todos**](/introduction/examples#todos): [Source](https://github.com/reduxkotlin/redux-kotlin/tree/master/examples/todos)

0 commit comments

Comments
 (0)