choo-persist-cordova
v1.0.2
Published
choo cordova state
Downloads
3
Readme
choo-persist-cordova
persist choo state with the cordova file api
Install cordova file plugin
cordova plugin add cordova-plugin-file
See /www for cordova example
var choo = require('choo')
var html = require('choo/html')
var css = require('sheetify')
var _app = choo ()
_app.use(require('choo-persist-cordova')())
_app.use(function (state, emitter) {
if (!state.incro) state.incro = 0
})
_app.route('/', function (state, emit) {
var style = css`
:host {
padding-left: 9px;
}
`
state.incro = state.incro + 1
return html`
<div class=${style}>
<h1>HELLO</h1>
<p>hello world ${state.incro}!</p>
</div>
`
})
Install
npm install choo-persist-cordova --save