Skip to content

Commit 120c62f

Browse files
committed
Reformat things
1 parent 4315cb1 commit 120c62f

File tree

7 files changed

+73
-66
lines changed

7 files changed

+73
-66
lines changed

README.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
# Redux Starter Kit
2-
3-
[![build status](https://img.shields.io/travis/reduxjs/redux-starter-kit/master.svg?style=flat-square)](https://travis-ci.org/reduxjs/redux-starter-kit)
4-
[![npm version](https://img.shields.io/npm/v/redux-starter-kit.svg?style=flat-square)](https://www.npmjs.com/package/redux-starter-kit)
5-
[![npm downloads](https://img.shields.io/npm/dm/redux-starter-kit.svg?style=flat-square)](https://www.npmjs.com/package/redux-starter-kit)
6-
7-
**A simple set of tools to make using Redux easier**
8-
9-
`npm install redux-starter-kit`
10-
11-
(Special thanks to Github user @shotak for donating to the package name.)
12-
13-
### Purpose
14-
15-
The `redux-starter-kit` package is intended to help address three common complaints about Redux:
16-
17-
* "Configuring a Redux store is too complicated"
18-
* "I have to add a lot of packages to get Redux to do anything useful"
19-
* "Redux requires too much boilerplate code"
20-
21-
We can't solve every use case, but in the spirit of [`create-react-app`](https://github.com/facebook/create-react-app) and [`apollo-boost`](https://dev-blog.apollodata.com/zero-config-graphql-state-management-27b1f1b3c2c3), we can try to provide some tools that abstract over the setup process and handle the most common use cases, as well as include some useful utilities that will let the user simplify their application code.
22-
23-
This package is _not_ intended to solve every possible complaint 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.
24-
25-
### What's Included
26-
27-
`redux-starter-kit` includes:
28-
29-
* 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.
30-
* 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`.
31-
* A `createAction()` utility that returns an action creator function for the given action type string. The function itself has `toString()` defined, so that it can be used in place of the type constant.
32-
* A `createSlice()` function that accepts a set of reducer functions, a slice name, and an initial state value, and automatically generates corresponding action creators, types, and simple selector functions.
33-
* An improved version of the widely used `createSelector` utility for creating memoized selector functions, which can accept string keypaths as "input selectors" (re-exported from the [`selectorator` library](https://github.com/planttheidea/selectorator)).
34-
35-
## Documentation
36-
37-
The `redux-starter-kit` docs are now published at **https://redux-starter-kit.js.org**.
38-
39-
We're currently expanding and rewriting our docs content - check back soon for more updates!
1+
# Redux Starter Kit
2+
3+
[![build status](https://img.shields.io/travis/reduxjs/redux-starter-kit/master.svg?style=flat-square)](https://travis-ci.org/reduxjs/redux-starter-kit)
4+
[![npm version](https://img.shields.io/npm/v/redux-starter-kit.svg?style=flat-square)](https://www.npmjs.com/package/redux-starter-kit)
5+
[![npm downloads](https://img.shields.io/npm/dm/redux-starter-kit.svg?style=flat-square)](https://www.npmjs.com/package/redux-starter-kit)
6+
7+
**A simple set of tools to make using Redux easier**
8+
9+
`npm install redux-starter-kit`
10+
11+
(Special thanks to Github user @shotak for donating to the package name.)
12+
13+
### Purpose
14+
15+
The `redux-starter-kit` package is intended to help address three common complaints about Redux:
16+
17+
- "Configuring a Redux store is too complicated"
18+
- "I have to add a lot of packages to get Redux to do anything useful"
19+
- "Redux requires too much boilerplate code"
20+
21+
We can't solve every use case, but in the spirit of [`create-react-app`](https://github.com/facebook/create-react-app) and [`apollo-boost`](https://dev-blog.apollodata.com/zero-config-graphql-state-management-27b1f1b3c2c3), we can try to provide some tools that abstract over the setup process and handle the most common use cases, as well as include some useful utilities that will let the user simplify their application code.
22+
23+
This package is _not_ intended to solve every possible complaint 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.
24+
25+
### What's Included
26+
27+
`redux-starter-kit` includes:
28+
29+
- 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.
30+
- 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`.
31+
- A `createAction()` utility that returns an action creator function for the given action type string. The function itself has `toString()` defined, so that it can be used in place of the type constant.
32+
- A `createSlice()` function that accepts a set of reducer functions, a slice name, and an initial state value, and automatically generates corresponding action creators, types, and simple selector functions.
33+
- An improved version of the widely used `createSelector` utility for creating memoized selector functions, which can accept string keypaths as "input selectors" (re-exported from the [`selectorator` library](https://github.com/planttheidea/selectorator)).
34+
35+
## Documentation
36+
37+
The `redux-starter-kit` docs are now published at **https://redux-starter-kit.js.org**.
38+
39+
We're currently expanding and rewriting our docs content - check back soon for more updates!

docs/api/createSelector.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ Example usage:
2424

2525
```js
2626
// Define input selector using a string keypath
27-
const getSubtotal = createSelector(['shop.items'], items => {
28-
// return value here
29-
})
27+
const getSubtotal = createSelector(
28+
['shop.items'],
29+
items => {
30+
// return value here
31+
}
32+
)
3033
3134
// Define input selectors as a mix of other selectors and string keypaths
3235
const getTax = createSelector(

docs/introduction/quick-start.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ hide_title: true
1111

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

14-
* "Configuring a Redux store is too complicated"
15-
* "I have to add a lot of packages to get Redux to do anything useful"
16-
* "Redux requires too much boilerplate code"
14+
- "Configuring a Redux store is too complicated"
15+
- "I have to add a lot of packages to get Redux to do anything useful"
16+
- "Redux requires too much boilerplate code"
1717

1818
We can't solve every use case, but in the spirit of [`create-react-app`](https://github.com/facebook/create-react-app) and [`apollo-boost`](https://dev-blog.apollodata.com/zero-config-graphql-state-management-27b1f1b3c2c3), we can try to provide some tools that abstract over the setup process and handle the most common use cases, as well as include some useful utilities that will let the user simplify their application code.
1919

@@ -27,11 +27,11 @@ you make your Redux code better.
2727

2828
`redux-starter-kit` includes:
2929

30-
* 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.
31-
* 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`.
32-
* A `createAction()` utility that returns an action creator function for the given action type string. The function itself has `toString()` defined, so that it can be used in place of the type constant.
33-
* A `createSlice()` function that accepts a set of reducer functions, a slice name, and an initial state value, and automatically generates corresponding action creators, types, and simple selector functions.
34-
* An improved version of the widely used `createSelector` utility for creating memoized selector functions, which can accept string keypaths as "input selectors" (re-exported from the [`selectorator` library](https://github.com/planttheidea/selectorator)).
30+
- 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.
31+
- 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`.
32+
- A `createAction()` utility that returns an action creator function for the given action type string. The function itself has `toString()` defined, so that it can be used in place of the type constant.
33+
- A `createSlice()` function that accepts a set of reducer functions, a slice name, and an initial state value, and automatically generates corresponding action creators, types, and simple selector functions.
34+
- An improved version of the widely used `createSelector` utility for creating memoized selector functions, which can accept string keypaths as "input selectors" (re-exported from the [`selectorator` library](https://github.com/planttheidea/selectorator)).
3535

3636
## Installation
3737

rollup.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ export default [
1818
},
1919
plugins: [
2020
babel({
21-
exclude: "node_modules/**",
21+
exclude: 'node_modules/**'
2222
}),
2323
resolve(),
2424
replace({
2525
'process.env.NODE_ENV': JSON.stringify('development')
2626
}),
27-
commonjs({
28-
namedExports: {
29-
'node_modules/curriable/dist/curriable.js': ['curry', '__'],
30-
}
31-
})
27+
commonjs({
28+
namedExports: {
29+
'node_modules/curriable/dist/curriable.js': ['curry', '__']
30+
}
31+
})
3232
]
3333
},
3434

src/configureStore.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ export function configureStore(options = {}) {
4747

4848
let finalCompose = compose
4949

50-
if(devTools) {
50+
if (devTools) {
5151
finalCompose = composeWithDevTools({
52-
// Enable capture of stack traces for dispatched Redux actions
53-
trace : !IS_PRODUCTION
52+
// Enable capture of stack traces for dispatched Redux actions
53+
trace: !IS_PRODUCTION
5454
})
5555
}
5656

src/serializableStateInvariantMiddleware.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function isPlain(val) {
88
typeof val === 'boolean' ||
99
typeof val === 'number' ||
1010
Array.isArray(val) ||
11-
isPlainObject(val)
11+
isPlainObject(val)
1212
)
1313
}
1414

@@ -67,7 +67,11 @@ export default function createSerializableStateInvariantMiddleware(
6767
const { isSerializable = isPlain } = options
6868

6969
return storeAPI => next => action => {
70-
const foundActionNonSerializableValue = findNonSerializableValue(action, [], isSerializable)
70+
const foundActionNonSerializableValue = findNonSerializableValue(
71+
action,
72+
[],
73+
isSerializable
74+
)
7175

7276
if (foundActionNonSerializableValue) {
7377
const { keyPath, value } = foundActionNonSerializableValue

website/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ This website was created with [Docusaurus](https://docusaurus.io/).
22

33
# What's In This Document
44

5-
* [Get Started in 5 Minutes](#get-started-in-5-minutes)
6-
* [Directory Structure](#directory-structure)
7-
* [Editing Content](#editing-content)
8-
* [Adding Content](#adding-content)
9-
* [Full Documentation](#full-documentation)
5+
- [Get Started in 5 Minutes](#get-started-in-5-minutes)
6+
- [Directory Structure](#directory-structure)
7+
- [Editing Content](#editing-content)
8+
- [Adding Content](#adding-content)
9+
- [Full Documentation](#full-documentation)
1010

1111
# Get Started in 5 Minutes
1212

0 commit comments

Comments
 (0)