Pluralize "times" correctly

This commit is contained in:
Juan Soto
2016-07-15 09:22:26 -04:00
parent 17959b8105
commit 9fb124cf1c
12 changed files with 305 additions and 38 deletions
+4 -1
View File
@@ -1,5 +1,6 @@
const choo = require('../../')
const html = require('../../html')
const plur = require('plur')
const app = choo()
app.model({
@@ -21,10 +22,12 @@ app.model({
})
const mainView = (state, prev, send) => {
const count = state.counter;
return html`
<main class="app">
<h1>Async counter</h1>
<p>Clicked ${state.counter} times!</p>
<p>Clicked ${count} ${plur('time', count)}!</p>
<button onclick=${() => send('increment')}>Increment</button>
<button onclick=${() => send('decrement')}>Decrement</button>
<button onclick=${() => send('incrementAsync')}>Increment async</button>