Skip to content

Commit 074aa0d

Browse files
committed
adds GIF of reset counter in action! fixes #5 https://youtu.be/sVzvRsl4rEM
1 parent 148a535 commit 074aa0d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Diff for: README.md

+7
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,13 @@ Watch the UI tests go red in the browser:
443443

444444
#### 9.6 Make UI Tests Pass (_writing the minimum code_)
445445

446+
Luckily _both_ these tests only requires a _single_ line of code to make pass!
447+
448+
```js
449+
button('Reset', signal, Res)
450+
```
451+
![reset-counter](https://cloud.githubusercontent.com/assets/194400/25822128/82eb7a8e-342f-11e7-9cd0-1a69d95ee878.gif)
452+
446453

447454

448455
<br /> <br />

Diff for: examples/counter-reset/counter.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ function view(signal, model, root) {
3131
empty(root); // clear root element before
3232
return [ // Store DOM nodes in an array
3333
button('+', signal, Inc), // then iterate to append them
34-
div('count', model), // avoids repetition.
34+
div('count', model), // create div with stat as text
3535
button('-', signal, Dec), // decrement counter
3636
button('Reset', signal, Res) // reset counter
3737
].forEach(function(el){ root.appendChild(el) }); // forEach is ES5 so IE9+
3838
} // yes, for loop is "faster" than forEach, but readability trumps "perf" here!
3939

40+
4041
// The following are "Helper" Functions which each "Do ONLY One Thing" and are
4142
// used in the "View" function to render the Model (State) to the Browser DOM:
4243

0 commit comments

Comments
 (0)