Skip to content

Commit 04cdb02

Browse files
authored
Add a "Usage Guide" docs page (#105)
* Change naming, format things * Add incomplete usage guide page * Finish filling out usage guide
1 parent e2a05b6 commit 04cdb02

File tree

7 files changed

+543
-13
lines changed

7 files changed

+543
-13
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
### Purpose
1616

17-
The `redux-starter-kit` package is intended to help address three common concerns about Redux:
17+
The Redux Starter Kit package is intended to help address three common concerns about Redux:
1818

1919
- "Configuring a Redux store is too complicated"
2020
- "I have to add a lot of packages to get Redux to do anything useful"
@@ -26,7 +26,7 @@ This package is _not_ intended to solve every possible concern about Redux, and
2626

2727
### What's Included
2828

29-
`redux-starter-kit` includes:
29+
Redux Starter Kit includes:
3030

3131
- A `configureStore()` function with simplified configuration options. It can automatically combine your slice reducers, adds whatever Redux middleware you supply, includes `redux-thunk` by default, and enables use of the Redux DevTools Extension.
3232
- A `createReducer()` utility that lets you supply a lookup table of action types to case reducer functions, rather than writing switch statements. In addition, it automatically uses the [`immer` library](https://github.com/mweststrate/immer) to let you write simpler immutable updates with normal mutative code, like `state.todos[3].completed = true`.
@@ -36,6 +36,6 @@ This package is _not_ intended to solve every possible concern about Redux, and
3636

3737
## Documentation
3838

39-
The `redux-starter-kit` docs are now published at **https://redux-starter-kit.js.org**.
39+
The Redux Starter Kit docs are now published at **https://redux-starter-kit.js.org**.
4040

4141
We're currently expanding and rewriting our docs content - check back soon for more updates!

docs/api/createAction.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ let action = increment()
4040
action = increment(3)
4141
// returns { type: 'counter/increment', payload: 3 }
4242

43-
increment.toString()
43+
console.log(increment.toString())
4444
// 'counter/increment'
4545

46-
`The action type is: ${increment}`
46+
console.log(`The action type is: ${increment}`)
4747
// 'The action type is: counter/increment'
4848
```
4949

@@ -67,7 +67,7 @@ This works because object keys that are not natively supported by JavaScript (li
6767

6868
In principle, Redux lets you use any kind of value as an action type. Instead of strings, you could theoretically use numbers, [symbols](https://developer.mozilla.org/en-US/docs/Glossary/Symbol), or anything else ([although it's recommended that the value should at least be serializable](https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)).
6969

70-
However, `redux-starter-kit` rests on the assumption that you use string action types. Specifically, some of its features rely on the fact that with strings, the `toString()` method of an `createAction()` action creator returns the matching action type. This is not the case for non-string action types because `toString()` will return the string-converted type value rather than the type itself.
70+
However, Redux Starter Kit rests on the assumption that you use string action types. Specifically, some of its features rely on the fact that with strings, the `toString()` method of an `createAction()` action creator returns the matching action type. This is not the case for non-string action types because `toString()` will return the string-converted type value rather than the type itself.
7171

7272
```js
7373
const INCREMENT = Symbol('increment')

docs/api/getDefaultMiddleware.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ const store = configureStore({
5151

5252
### Development
5353

54-
One of the goals of `redux-starter-kit` is to provide opinionated defaults and prevent common mistakes. As part of that,
54+
One of the goals of Redux Starter Kit is to provide opinionated defaults and prevent common mistakes. As part of that,
5555
`getDefaultMiddleware` includes some middleware that are added **in development builds of your app only** to
5656
provide runtime checks for two common issues:
5757

5858
- [`redux-immutable-state-invariant`](https://github.com/leoasis/redux-immutable-state-invariant): deeply compares
5959
state values for mutations. It can detect mutations in reducers during a dispatch, and also mutations that occur between
6060
dispatches (such as in a component or a selector). When a mutation is detect, it will throw an error and indicate the key
6161
path for where the mutated value was detected in the state tree.
62-
- `serializable-state-invariant-middleware`: a custom middleware created specifically for use in `redux-starter-kit`. Similar in
62+
- `serializable-state-invariant-middleware`: a custom middleware created specifically for use in Redux Starter Kit. Similar in
6363
concept to `redux-immutable-state-invariant`, but deeply checks your state tree and your actions for non-serializable values
6464
such as functions, Promises, Symbols, and other non-plain-JS-data values. When a non-serializable value is detected, a
6565
console error will be printed with the key path for where the non-serializable value was detected.

docs/api/otherExports.md

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

88
# Other Exports
99

10-
`redux-starter-kit` exports some of its internal utilities, and re-exports additional functions from other dependencies as well.
10+
Redux Starter Kit exports some of its internal utilities, and re-exports additional functions from other dependencies as well.
1111

1212
## Internal Exports
1313

docs/introduction/quick-start.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ hide_title: true
99

1010
## Purpose
1111

12-
The **`redux-starter-kit`** package is intended to help address three common concerns about Redux:
12+
The **Redux Starter Kit** package is intended to help address three common concerns about Redux:
1313

1414
- "Configuring a Redux store is too complicated"
1515
- "I have to add a lot of packages to get Redux to do anything useful"
@@ -20,12 +20,12 @@ We can't solve every use case, but in the spirit of [`create-react-app`](https:/
2020
This package is _not_ intended to solve every possible concern about Redux, and is deliberately limited in scope. It does _not_ address concepts like "reusable encapsulated Redux modules", data fetching, folder or file structures, managing entity relationships in the store, and so on.
2121

2222
That said, **these tools should be beneficial to all Redux users**. Whether you're a brand new Redux user setting up your
23-
first project, or an experienced user who wants to simplify an existing application, **`redux-starter-kit`** can help
23+
first project, or an experienced user who wants to simplify an existing application, **Redux Starter Kit** can help
2424
you make your Redux code better.
2525

2626
## What's Included
2727

28-
`redux-starter-kit` includes:
28+
Redux Starter Kit includes:
2929

3030
- A [`configureStore()` function](../api/configureStore.md) with simplified configuration options. It can automatically combine your slice reducers, adds whatever Redux middleware you supply, includes `redux-thunk` by default, and enables use of the Redux DevTools Extension.
3131
- A [`createReducer()` utility](../api/createReducer.md) that lets you supply a lookup table of action types to case reducer functions, rather than writing switch statements. In addition, it automatically uses the [`immer` library](https://github.com/mweststrate/immer) to let you write simpler immutable updates with normal mutative code, like `state.todos[3].completed = true`.
@@ -35,7 +35,7 @@ you make your Redux code better.
3535

3636
## Installation
3737

38-
`redux-starter-kit` is available as a package on NPM for use with a module bundler or in a Node application:
38+
Redux Starter Kit is available as a package on NPM for use with a module bundler or in a Node application:
3939

4040
```bash
4141
npm install --save redux-starter-kit

0 commit comments

Comments
 (0)