Pluralize "times" correctly
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"author": "Juan Soto <juan@juansoto.me>",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"budo": "^8.3.0"
|
||||
"budo": "^8.3.0",
|
||||
"plur": "^2.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user