Skip to content

Commit b18a291

Browse files
committed
patch/doc: Type-os in README
1 parent 794a2bb commit b18a291

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ First, you'll need to define your redux state.
9494
// NameReduxState.js
9595
import { createReduxModule } from "hooks-for-redux";
9696

97-
// - initialize redux state.name = 'Alice'
97+
// - initialize redux state.count = 0
9898
// - export useCount hook for use in components
99-
// - export setCount to update state.name
99+
// - export setCount to update state.count
100100
export const [useCount, setCount] = createReduxModule("count", 0);
101101
```
102102

@@ -236,7 +236,7 @@ createReduxModule(reduxStorePropertyName, initialState, reducers) =>
236236

237237
Define a top-level property of the redux state including its initial value, all related reducers, and returns a react-hook, dispatchers and virtualStore.
238238

239-
- **IN**: (reduxStorePropertyName, initialState)
239+
- **IN**: (reduxStorePropertyName, initialState, reducers)
240240

241241
- reduxStorePropertyName: string
242242
- initialState: non-null, non-undefined
@@ -246,8 +246,9 @@ Define a top-level property of the redux state including its initial value, all
246246
- **OUT**: [useMyStore, setMyStore -or- myDispatchers, virtualStore]
247247
- useMyStore: react hook returning current state
248248
- One of the following:
249-
- setMyStore: (newState) => dispatch structure
250-
- myDispatchers: object mapping action names to matching myDispatchers
249+
- setMyStore: `(newState) => dispatcher-results`
250+
- myDispatchers: object mapping action names to dispatchers
251+
- `{myAction: (payload) => dispatcher-results}`}
251252
- virtualStore: object with API similar to a redux store, but just for the state defined in this createReduxModule call
252253

253254
#### useMyStore
@@ -335,7 +336,7 @@ import {getState} from 'hooks-for-redux'
335336

336337
### Store Registry API
337338

338-
Getting started, you can ignore the store registry. It's goal is to automatically manage creating your store and making sure all your code has access. However, if you want to customize your redux store, it's easy to do (see the [custom middleware example](#example-custom-middleware) above).
339+
Getting started, you can ignore the store registry. Its goal is to automatically manage creating your store and making sure all your code has access. However, if you want to customize your redux store, it's easy to do (see the [custom middleware example](#example-custom-middleware) above).
339340

340341
#### getStore
341342

@@ -442,7 +443,7 @@ const Provider = ({ store = getStore(), context, children }) =>
442443

443444
- source: [src/createReduxModule.js](src/createReduxModule.js)
444445

445-
The big win, however, comes from one key observation: if you are writing your own routing, you are doing it wrong. The same can be said for dispatching and subscriptions.
446+
H4R's biggest win comes from one key observation: *if you are writing your own routing, you are doing it wrong.* The same can be said for dispatching and subscriptions.
446447

447448
The `createReduxModule` function automates all the manual routing required to make plain Redux work. It inputs only the essential data and functions necessary to define a redux model, and it returns all the tools you need to use it.
448449

0 commit comments

Comments
 (0)