Skip to content

Commit a405fd7

Browse files
authored
polish index.html
1 parent 8685630 commit a405fd7

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

examples/counter-vanilla/index.html

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,52 +17,52 @@
1717
<script>
1818
function counter(state, action) {
1919
if (typeof state === 'undefined') {
20-
return 0
20+
return 0;
2121
}
2222

2323
switch (action.type) {
2424
case 'INCREMENT':
25-
return state + 1
25+
return state + 1;
2626
case 'DECREMENT':
27-
return state - 1
27+
return state - 1;
2828
default:
29-
return state
29+
return state;
3030
}
3131
}
3232

33-
var store = Redux.createStore(counter)
34-
var valueEl = document.getElementById('value')
33+
const store = Redux.createStore(counter);
34+
const valueEl = document.getElementById('value');
3535

3636
function render() {
37-
valueEl.innerHTML = store.getState().toString()
37+
valueEl.innerHTML = store.getState().toString();
3838
}
3939

40-
render()
41-
store.subscribe(render)
40+
render();
41+
store.subscribe(render);
4242

4343
document.getElementById('increment')
4444
.addEventListener('click', function () {
45-
store.dispatch({ type: 'INCREMENT' })
46-
})
45+
store.dispatch({ type: 'INCREMENT' });
46+
});
4747

4848
document.getElementById('decrement')
4949
.addEventListener('click', function () {
5050
store.dispatch({ type: 'DECREMENT' })
51-
})
51+
});
5252

5353
document.getElementById('incrementIfOdd')
5454
.addEventListener('click', function () {
5555
if (store.getState() % 2 !== 0) {
56-
store.dispatch({ type: 'INCREMENT' })
56+
store.dispatch({ type: 'INCREMENT' });
5757
}
58-
})
58+
});
5959

6060
document.getElementById('incrementAsync')
6161
.addEventListener('click', function () {
6262
setTimeout(function () {
63-
store.dispatch({ type: 'INCREMENT' })
64-
}, 1000)
65-
})
63+
store.dispatch({ type: 'INCREMENT' });
64+
}, 1000);
65+
});
6666
</script>
6767
</body>
6868
</html>

0 commit comments

Comments
 (0)