Skip to content

Commit

Permalink
docs: fix store methods link (reduxjs#3497)
Browse files Browse the repository at this point in the history
Former-commit-id: db7d881
  • Loading branch information
kon-shou authored and timdorr committed Aug 4, 2019
1 parent 63bf180 commit 0423fb9
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/Glossary.md.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f1e22652399d08b263b74719ed8f39d7b5bdd27b
de724b1ca1df66086e2e63dca00fd8072312fdd9
2 changes: 1 addition & 1 deletion docs/Troubleshooting.md.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
27d89aaee84620f27810f2e4f790f0a9848e5fb4
3396f25b19f4d2e560ed90b0ed297fd99a7c35b7
2 changes: 1 addition & 1 deletion docs/advanced/AsyncFlow.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Without [middleware](Middleware.md), Redux store only supports [synchronous data

You may enhance [`createStore()`](../api/createStore.md) with [`applyMiddleware()`](../api/applyMiddleware.md). It is not required, but it lets you [express asynchronous actions in a convenient way](AsyncActions.md).

Asynchronous middleware like [redux-thunk](https://github.com/gaearon/redux-thunk) or [redux-promise](https://github.com/acdlite/redux-promise) wraps the store's [`dispatch()`](../api/Store.md#dispatch) method and allows you to dispatch something other than actions, for example, functions or Promises. Any middleware you use can then intercept anything you dispatch, and in turn, can pass actions to the next middleware in the chain. For example, a Promise middleware can intercept Promises and dispatch a pair of begin/end actions asynchronously in response to each Promise.
Asynchronous middleware like [redux-thunk](https://github.com/gaearon/redux-thunk) or [redux-promise](https://github.com/acdlite/redux-promise) wraps the store's [`dispatch()`](../api/Store.md#dispatchaction) method and allows you to dispatch something other than actions, for example, functions or Promises. Any middleware you use can then intercept anything you dispatch, and in turn, can pass actions to the next middleware in the chain. For example, a Promise middleware can intercept Promises and dispatch a pair of begin/end actions asynchronously in response to each Promise.

When the last middleware in the chain dispatches an action, it has to be a plain object. This is when the [synchronous Redux data flow](../basics/DataFlow.md) takes place.

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/Middleware.md.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bbc1e5225652f760034e8bb3ea51eb5ce794564a
a573d2a32cfc6baaa712f47a489ba4db0ee50460
6 changes: 3 additions & 3 deletions docs/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ This section documents the complete Redux API. Keep in mind that Redux is only c

- [Store](Store.md)
- [getState()](Store.md#getState)
- [dispatch(action)](Store.md#dispatch)
- [subscribe(listener)](Store.md#subscribe)
- [replaceReducer(nextReducer)](Store.md#replaceReducer)
- [dispatch(action)](Store.md#dispatchaction)
- [subscribe(listener)](Store.md#subscribelistener)
- [replaceReducer(nextReducer)](Store.md#replacereducernextreducer)

### Importing

Expand Down
2 changes: 1 addition & 1 deletion docs/api/Store.md.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
982db5858704d4b5502c1c7ef635b7e741d6dfa7
a1e3531009cbbed0d8e2b3bf76b2f96e0f6fe919
2 changes: 1 addition & 1 deletion docs/api/applyMiddleware.md.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
63f310bdeb2ea916e31d4a2a38371027e969fa63
39bb8971fca8a21d345eec00cebf9a7fc4830bbd
8 changes: 4 additions & 4 deletions docs/api/bindActionCreators.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ hide_title: true

# `bindActionCreators(actionCreators, dispatch)`

Turns an object whose values are [action creators](../Glossary.md#action-creator), into an object with the same keys, but with every action creator wrapped into a [`dispatch`](Store.md#dispatch) call so they may be invoked directly.
Turns an object whose values are [action creators](../Glossary.md#action-creator), into an object with the same keys, but with every action creator wrapped into a [`dispatch`](Store.md#dispatchaction) call so they may be invoked directly.

Normally you should just call [`dispatch`](Store.md#dispatch) directly on your [`Store`](Store.md) instance. If you use Redux with React, [react-redux](https://github.com/gaearon/react-redux) will provide you with the [`dispatch`](Store.md#dispatch) function so you can call it directly, too.
Normally you should just call [`dispatch`](Store.md#dispatchaction) directly on your [`Store`](Store.md) instance. If you use Redux with React, [react-redux](https://github.com/gaearon/react-redux) will provide you with the [`dispatch`](Store.md#dispatchaction) function so you can call it directly, too.

The only use case for `bindActionCreators` is when you want to pass some action creators down to a component that isn't aware of Redux, and you don't want to pass [`dispatch`](Store.md#dispatch) or the Redux store to it.
The only use case for `bindActionCreators` is when you want to pass some action creators down to a component that isn't aware of Redux, and you don't want to pass [`dispatch`](Store.md#dispatchaction) or the Redux store to it.

For convenience, you can also pass an action creator as the first argument, and get a dispatch wrapped function in return.

#### Parameters

1. `actionCreators` (_Function_ or _Object_): An [action creator](../Glossary.md#action-creator), or an object whose values are action creators.

2. `dispatch` (_Function_): A [`dispatch`](Store.md#dispatch) function available on the [`Store`](Store.md) instance.
2. `dispatch` (_Function_): A [`dispatch`](Store.md#dispatchaction) function available on the [`Store`](Store.md) instance.

#### Returns

Expand Down
2 changes: 1 addition & 1 deletion docs/api/createStore.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ There should only be a single store in your app.

#### Returns

([_`Store`_](Store.md)): An object that holds the complete state of your app. The only way to change its state is by [dispatching actions](Store.md#dispatch). You may also [subscribe](Store.md#subscribe) to the changes to its state to update the UI.
([_`Store`_](Store.md)): An object that holds the complete state of your app. The only way to change its state is by [dispatching actions](Store.md#dispatchaction). You may also [subscribe](Store.md#subscribelistener) to the changes to its state to update the UI.

#### Example

Expand Down
4 changes: 2 additions & 2 deletions docs/basics/Actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ hide_title: true

First, let's define some actions.

**Actions** are payloads of information that send data from your application to your store. They are the _only_ source of information for the store. You send them to the store using [`store.dispatch()`](../api/Store.md#dispatch).
**Actions** are payloads of information that send data from your application to your store. They are the _only_ source of information for the store. You send them to the store using [`store.dispatch()`](../api/Store.md#dispatchaction).

Here's an example action which represents adding a new todo item:

Expand Down Expand Up @@ -107,7 +107,7 @@ boundAddTodo(text)
boundCompleteTodo(index)
```

The `dispatch()` function can be accessed directly from the store as [`store.dispatch()`](../api/Store.md#dispatch), but more likely you'll access it using a helper like [react-redux](http://github.com/gaearon/react-redux)'s `connect()`. You can use [`bindActionCreators()`](../api/bindActionCreators.md) to automatically bind many action creators to a `dispatch()` function.
The `dispatch()` function can be accessed directly from the store as [`store.dispatch()`](../api/Store.md#dispatchaction), but more likely you'll access it using a helper like [react-redux](http://github.com/gaearon/react-redux)'s `connect()`. You can use [`bindActionCreators()`](../api/bindActionCreators.md) to automatically bind many action creators to a `dispatch()` function.

Action creators can also be asynchronous and have side-effects. You can read about [async actions](../advanced/AsyncActions.md) in the [advanced tutorial](../advanced/README.md) to learn how to handle AJAX responses and compose action creators into async control flow. Don't skip ahead to async actions until you've completed the basics tutorial, as it covers other important concepts that are prerequisite for the advanced tutorial and async actions.

Expand Down
6 changes: 3 additions & 3 deletions docs/basics/DataFlow.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you're still not convinced, read [Motivation](../introduction/Motivation.md)

The data lifecycle in any Redux app follows these 4 steps:

1. **You call** [`store.dispatch(action)`](../api/Store.md#dispatch).
1. **You call** [`store.dispatch(action)`](../api/Store.md#dispatchaction).

An [action](Actions.md) is a plain object describing _what happened_. For example:

Expand All @@ -27,7 +27,7 @@ An [action](Actions.md) is a plain object describing _what happened_. For exampl

Think of an action as a very brief snippet of news. “Mary liked article 42.” or “'Read the Redux docs.' was added to the list of todos.”

You can call [`store.dispatch(action)`](../api/Store.md#dispatch) from anywhere in your app, including components and XHR callbacks, or even at scheduled intervals.
You can call [`store.dispatch(action)`](../api/Store.md#dispatchaction) from anywhere in your app, including components and XHR callbacks, or even at scheduled intervals.

2. **The Redux store calls the reducer function you gave it.**

Expand Down Expand Up @@ -100,7 +100,7 @@ While [`combineReducers()`](../api/combineReducers.md) is a handy helper utility

4. **The Redux store saves the complete state tree returned by the root reducer.**

This new tree is now the next state of your app! Every listener registered with [`store.subscribe(listener)`](../api/Store.md#subscribe) will now be invoked; listeners may call [`store.getState()`](../api/Store.md#getState) to get the current state.
This new tree is now the next state of your app! Every listener registered with [`store.subscribe(listener)`](../api/Store.md#subscribelistener) will now be invoked; listeners may call [`store.getState()`](../api/Store.md#getState) to get the current state.

Now, the UI can be updated to reflect the new state. If you use bindings like [React Redux](https://github.com/gaearon/react-redux), this is the point at which `component.setState(newState)` is called.

Expand Down
6 changes: 3 additions & 3 deletions docs/basics/Store.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ The **Store** is the object that brings them together. The store has the followi

- Holds application state;
- Allows access to state via [`getState()`](../api/Store.md#getState);
- Allows state to be updated via [`dispatch(action)`](../api/Store.md#dispatch);
- Registers listeners via [`subscribe(listener)`](../api/Store.md#subscribe);
- Handles unregistering of listeners via the function returned by [`subscribe(listener)`](../api/Store.md#subscribe).
- Allows state to be updated via [`dispatch(action)`](../api/Store.md#dispatchaction);
- Registers listeners via [`subscribe(listener)`](../api/Store.md#subscribelistener);
- Handles unregistering of listeners via the function returned by [`subscribe(listener)`](../api/Store.md#subscribelistener).

It's important to note that you'll only have a single store in a Redux application. When you want to split your data handling logic, you'll use [reducer composition](Reducers.md#splitting-reducers) instead of many stores.

Expand Down
2 changes: 1 addition & 1 deletion docs/basics/UsageWithReact.md.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
096182d8ce4140624f483af32cec226808be5617
3bc00bb07f751419aeb4daf6e5806b0ba2d3c001
2 changes: 1 addition & 1 deletion docs/recipes/ReducingBoilerplate.md.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e5adb02ee0a7e57874d61544b72809236092972c
a851d648a911d0f1478c7ff0055aaaaf78ed75bc
2 changes: 1 addition & 1 deletion src/createStore.js.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
efb89310fdb6aadd208a379f935ef42a19714247
cef9a2ecaeff319d4986af24babf1c79ec9912c6

0 comments on commit 0423fb9

Please sign in to comment.