开发者社区> 镜像站> NPM> choo-cordova
choo-cordova
Choo hooks for the cordova API
Last updated 3 years ago by yerkopalma .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install choo-cordova 
SYNC missed versions from official npm registry.

choo-cordova

Build Status js-standard-style

Choo hooks for the cordova API

Usage

var choo = require('choo')

var app = choo()

app.use(require('choo-cordova'))

app.route('/', require('./views/main'))
app.mount('#app')

Events

This store emit events for every cordova events. Those events are:

  • 'deviceready'
  • 'pause'
  • 'resume'
  • 'backbutton'
  • 'menubutton'
  • 'searchbutton'
  • 'startcallbutton'
  • 'endcallbutton'
  • 'volumedownbutton'
  • 'volumeupbutton'
  • 'activated'

For further documentation about those, check cordova docs

API

After registering this store, a cordova property will be added to the store. This will have some of the cordova object properties. As the time of writing, this object looks like.

JSON.stringify(choo.state.cordova, null, 2)
"{
  "version": "5.0.3",
  "platformVersion": "5.0.3",
  "platformId": "browser",
  "callbackId": 65806389,
  "callbacks": {},
  "callbackStatus": {
    "NO_RESULT": 0,
    "OK": 1,
    "CLASS_NOT_FOUND_EXCEPTION": 2,
    "ILLEGAL_ACCESS_EXCEPTION": 3,
    "INSTANTIATION_EXCEPTION": 4,
    "MALFORMED_URL_EXCEPTION": 5,
    "IO_EXCEPTION": 6,
    "INVALID_ACTION": 7,
    "JSON_EXCEPTION": 8,
    "ERROR": 9
  },
  "commandProxy": {}
}"

License

MIT

Current Tags

  • 0.1.1                                ...           latest (3 years ago)

2 Versions

  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (0)
None
Dev Dependencies (4)
Dependents (0)
None