Skip to content

Commit 8217b0e

Browse files
committed
format code
1 parent 7180b8b commit 8217b0e

File tree

1 file changed

+28
-30
lines changed

1 file changed

+28
-30
lines changed

examples/counter/src/app.jsx

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,38 @@
11
import React from 'react';
2-
import {render} from 'react-dom';
3-
import Most, {connect} from '../../../lib/react-most'
2+
import { render } from 'react-dom';
3+
import Most, { connect } from '../../../lib/react-most'
44

55
const CounterView = props => (
6-
<div>
7-
<button onClick={props.actions.dec}-</button>
8-
<span>{props.count}</span>
9-
<button onClick={props.actions.inc}>+</button>
10-
</div>
11-
)
12-
}
13-
})
6+
<div>
7+
<button onClick={props.actions.dec}>-</button>
8+
<span>{props.count}</span>
9+
<button onClick={props.actions.inc}>+</button>
10+
</div>
11+
)
1412

15-
CounterView.defaultProps = {count: 0};
13+
CounterView.defaultProps = { count: 0 };
1614

17-
const reactify = connect((intent$)=>{
18-
return {
19-
sink$: intent$.map(intent => {
20-
switch(intent.type) {
21-
case 'inc':
22-
return state => ({count: state.count+1});
23-
case 'dec':
24-
return state => ({count: state.count-1});
25-
default:
26-
return _ => _;
27-
}
28-
}),
29-
inc: () => ({type: 'inc'}),
30-
dec: () => ({type: 'dec'}),
31-
}
15+
const reactify = connect((intent$) => {
16+
return {
17+
sink$: intent$.map(intent => {
18+
switch (intent.type) {
19+
case 'inc':
20+
return state => ({ count: state.count + 1 });
21+
case 'dec':
22+
return state => ({ count: state.count - 1 });
23+
default:
24+
return _ => _;
25+
}
26+
}),
27+
inc: () => ({ type: 'inc' }),
28+
dec: () => ({ type: 'dec' }),
29+
}
3230
})
3331

3432
const Counter = reactify(CounterView)
3533

3634
render(
37-
<Most>
38-
<Counter />
39-
</Most>
40-
, document.getElementById('app'));
35+
<Most>
36+
<Counter />
37+
</Most>
38+
, document.getElementById('app'));

0 commit comments

Comments
 (0)