Development logger for choo.
const log = require('choo-log')
const choo = require('choo')
const app = choo()
app.use(log())
const tree = app.start()
document.body.appendChild(tree)
And to optimize for production using envify:
const choo = require('choo')
const app = choo()
// this block of code will be eliminated by any minification if
// NODE_ENV is set to "production"
if (process.env.NODE_ENV !== 'production') {
const log = require('choo-log')
app.use(log())
}
Create a new logger instance. Listens to:
onAction()
: show the values inside of newactions
onError()
: display errorsonStateChange()
: show current state, previous state and a diff
$ npm install choo-log