Skip to content

Commit b5603fc

Browse files
committed
Format
1 parent 72a1e67 commit b5603fc

29 files changed

+466
-496
lines changed

docs/README.md

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
## Introduction
22

3-
1. [Quick Start](guides/quickstart.md)
4-
2. [Installation](guides/installation.md)
5-
3. [Architecture](guides/architecture.md)
6-
4. [Contributing](guides/contributing.md)
3+
1. [Quick Start](guides/quickstart.md)
4+
2. [Installation](guides/installation.md)
5+
3. [Architecture](guides/architecture.md)
6+
4. [Contributing](guides/contributing.md)
77

88
## API
99

10-
1. [Microcosm](api/microcosm.md)
11-
2. [Domains](api/domains.md)
12-
3. [Actions](api/actions.md)
13-
4. [Effects](api/effects.md)
14-
5. [History](api/history.md)
15-
6. [Immutability Helpers](api/immutability-helpers.md)
10+
1. [Microcosm](api/microcosm.md)
11+
2. [Domains](api/domains.md)
12+
3. [Actions](api/actions.md)
13+
4. [Effects](api/effects.md)
14+
5. [History](api/history.md)
15+
6. [Immutability Helpers](api/immutability-helpers.md)
1616

1717
## Addons
1818

19-
1. [Presenter](api/presenter.md)
20-
2. [ActionForm](api/action-form.md)
21-
3. [ActionButton](api/action-button.md)
22-
4. [withSend](api/with-send.md)
19+
1. [Presenter](api/presenter.md)
20+
2. [ActionForm](api/action-form.md)
21+
3. [ActionButton](api/action-button.md)
22+
4. [withSend](api/with-send.md)
2323

2424
## Testing
2525

26-
1. [Overview](testing/overview.md)
27-
2. [Domains](testing/domains.md)
28-
3. [Effects](testing/effects.md)
29-
4. [Presenters](testing/presenters.md)
26+
1. [Overview](testing/overview.md)
27+
2. [Domains](testing/domains.md)
28+
3. [Effects](testing/effects.md)
29+
4. [Presenters](testing/presenters.md)
3030

3131
## Recipes
3232

33-
1. [React Router](recipes/react-router.md)
34-
2. [AJAX](recipes/ajax.md)
35-
3. [Preact](recipes/preact.md)
36-
4. [Hydrating State](recipes/hydrating-state.md)
37-
5. [Batch Updates](recipes/batch-updates.md)
33+
1. [React Router](recipes/react-router.md)
34+
2. [AJAX](recipes/ajax.md)
35+
3. [Preact](recipes/preact.md)
36+
4. [Hydrating State](recipes/hydrating-state.md)
37+
5. [Batch Updates](recipes/batch-updates.md)

docs/api/action-button.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# ActionButton
22

3-
1. [Overview](#overview)
4-
2. [Usage](#usage)
5-
3. [Props](#props)
3+
1. [Overview](#overview)
4+
2. [Usage](#usage)
5+
3. [Props](#props)
66

77
## Overview
88

@@ -22,27 +22,27 @@ const repo = new Microcosm()
2222
const increaseCount = n => n
2323

2424
repo.addDomain('count', {
25-
getInitialState () {
25+
getInitialState() {
2626
return 0
2727
},
28-
increase (count, amount) {
28+
increase(count, amount) {
2929
return count + amount
3030
},
31-
register () {
31+
register() {
3232
return {
33-
[increaseCount] : this.increase
33+
[increaseCount]: this.increase
3434
}
3535
}
3636
})
3737

3838
class CountPresenter extends Presenter {
39-
getModel () {
39+
getModel() {
4040
return {
41-
count : state => state.count
41+
count: state => state.count
4242
}
4343
}
4444

45-
render ({ count }) {
45+
render({ count }) {
4646
return (
4747
<ActionButton action={increaseCount} value={1}>
4848
{count}

docs/api/action-form.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# ActionForm
22

3-
1. [Overview](#overview)
4-
2. [Usage](#usage)
5-
3. [Props](#props)
3+
1. [Overview](#overview)
4+
2. [Usage](#usage)
5+
3. [Props](#props)
66

77
## Overview
88

@@ -24,20 +24,20 @@ const repo = new Microcosm()
2424
const increaseCount = n => n
2525

2626
repo.addDomain('count', {
27-
getInitialState () {
27+
getInitialState() {
2828
return 0
2929
},
30-
increase (count, amount) {
30+
increase(count, amount) {
3131
return count + amount
3232
},
33-
register () {
33+
register() {
3434
return {
35-
[increaseCount] : this.increase
35+
[increaseCount]: this.increase
3636
}
3737
}
3838
})
3939

40-
function StepperForm ({ count }) {
40+
function StepperForm({ count }) {
4141
return (
4242
<ActionForm action={increaseCount}>
4343
<input type="hidden" name="amount" value="1" />
@@ -47,18 +47,18 @@ function StepperForm ({ count }) {
4747
}
4848

4949
class CountPresenter extends Presenter {
50-
model () {
50+
model() {
5151
return {
52-
count : state => state.count
52+
count: state => state.count
5353
}
5454
}
5555

56-
view ({ count }) {
57-
return <StepperForm count={ count } />
56+
view({ count }) {
57+
return <StepperForm count={count} />
5858
}
5959
}
6060

61-
DOM.render(<CountPresenter repo={ repo } />, document.getElementById('container'))
61+
DOM.render(<CountPresenter repo={repo} />, document.getElementById('container'))
6262
```
6363

6464
ActionForm inputs are serialized to JSON upon submission using
@@ -86,14 +86,14 @@ other data formats that may come directly from a form input.
8686

8787
```javascript
8888
class MyForm extends React.Component {
89-
prepare (params) {
89+
prepare(params) {
9090
params.start = new Date(params.start).toISOString()
9191
params.end = new Date(params.start).toISOString()
9292

9393
return params
9494
}
9595

96-
render () {
96+
render() {
9797
return (
9898
<ActionForm action={actions.create} prepare={this.prepare}>
9999
<input name="name" />

0 commit comments

Comments
 (0)