Skip to content

Commit

Permalink
Document middleware rename to dispatch (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
BRA1L0R authored Feb 14, 2021
1 parent 2935f30 commit 9df1aca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Below is a consice recap of Hyperapp's core APIs and packages. It's geared towar
- [view](#view-prop)
- [subscriptions](#subscriptions-prop)
- [node](#node-prop)
- [middleware](#middleware-prop)
- [dispatch](#dispatch-prop)
- [`memo()`](#memo)
- [Actions](#actions)
- [Simple](#simple-action-state--nextstate)
Expand Down Expand Up @@ -120,14 +120,14 @@ app({
## app()

```js
app({ init, view, node, subscriptions, middleware })
app({ init, view, node, subscriptions, dispatch })
```

The app function is used to initialize and mount an hyperapp app.

There are 5 properties you can pass in to configure your app, all of which describe how your app will behave.

The first 3 options, init, view and node, are required. The last two, subscriptions and middleware, will depend on your use case.
The first 3 options, init, view and node, are required. The last two, subscriptions and dispatch, will depend on your use case.

```js
import { app } from "hyperapp";
Expand All @@ -139,7 +139,7 @@ app({
subscriptions: (state) => [
SomeSubscription
],
middleware: dispatch => /* newDispatch */
dispatch: dispatch => /* newDispatch */
});
```

Expand Down Expand Up @@ -218,7 +218,7 @@ Function that returns an array of [subscriptions](#subscriptions) for a given st

In a similar fashion to how the view function is used to dynamically add and remove DOM elements based on the state, this subscriptions function is used for dynamically adding and removing [subscriptions](#subscriptions) to the app.

#### middleware prop
#### dispatch prop

<!-- prettier-ignore -->
```js
Expand Down

0 comments on commit 9df1aca

Please sign in to comment.