JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 49
  • Score
    100M100P100Q73223F
  • License MIT

Expose a choo instance on the window

Package Exports

  • choo-devtools

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (choo-devtools) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

choo-devtools stability

npm version build status downloads js-standard-style

Console devtools for Choo. Useful for inspecting the state of applications, tuning performance, and quick iteration. No installation needed means it works in all browsers and Electron! ✨

Usage

var choo = require('choo')

var app = choo()
if (process.env.NODE_ENV !== 'production') {
  app.use(require('choo-devtools')())
}
app.mount('body')

Commands

choo.help

Print out information about all commands.

❯ choo.help

choo.state

Log out the Choo state object.

❯ choo.state

choo.debug

Log all state modificiations using object-change-callsite. Logs out the key, value, and stack trace for the change. Useful when you're dealing with unexpected values in your state. Especially useful when enabling asynchronous stack traces in the devtools.

// Enable debugging
❯ choo.debug

// Disable debugging
❯ choo.debug = false

choo.storage

Log out information about the browser's storage capabilities.

❯ choo.storage

choo.log

Log out the last 150 events that occured in Choo. Useful during debugging to quickly figure out which sequences of events were responsible for the current state.

❯ choo.log

To enable state snapshots on each event, call choo.debug. Be warned that this may severely impact performance – it's recommended to only use this for debugging state.

choo.copy([selector])

Serialize the current state to JSON and copy it to the clipboard. Can be passed a selector (such as href) to do a partial copy. Useful if you want to create a test based on the current application state.

// Copy all of state.
❯ choo.copy()

// Copy `state.href`.
❯ choo.copy('href')

choo.routes

Get an array with the registered routes.

❯ choo.routes

License

MIT