package
Console devtools for Choo
npm install choo-devtoolsGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
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! :sparkles:
var choo = require('choo')
var app = choo()
if (process.env.NODE_ENV !== 'production') {
app.use(require('choo-devtools')())
}
app.mount('body')var devtoolStore = require('choo-devtools')(opts)This module exposes a function that return a choo store. The function accept a single option argument, with the following properties:
eventName, data, timing and should return true
(the event will be logged) or false (the event wont be logged).choo.helpPrint out information about all commands.
❯ choo.helpchoo.stateLog out the Choo state object.
❯ choo.statechoo.debugLog 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 = falsechoo.storageLog out information about the browser's storage capabilities.
❯ choo.storagechoo.logLog 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.logTo 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.routesGet an array with the registered routes.
❯ choo.routeschoo.perf[type]Log out performance metrics for Choo. There are different types of entries we can show:
choo.perf.all Log out all data.choo.perf.core Only log out data about Choo's built-in methods.choo.perf.events Only log out information about the event bus.choo.perf.components Only log out information about components.benlyn
bendik.lynghaug@gmail.com
bret
bcomnes@gmail.com
lrlna
shestak.irina@gmail.com
yerkopalma
yerko.palma@usach.cl
juliangruber
julian@juliangruber.com
timwis
tim@timwis.com
ahdinosaur
michael.williams@enspiral.com
toddself
todd@selfassembled.org
sethvincent
sethvincent@gmail.com
maxogden
max@maxogden.com
shama
kyle@dontkry.com
freeman-lab
jeremy.freeman@mac.com
feross
feross@feross.org
emilbayes
github@tixz.dk
colingourlay
colin@colin-gourlay.com
jameskyburz
james.kyburz@gmail.com
almost
tom@almostobsolete.net
slaskis
robert@publicclass.se
ungoldman
ungoldman@gmail.com
graforlock
neatcube@gmail.com
tornqvist
carl@tornqv.ist
amongiants
jon@folderstudio.com
goto-bus-stop
npm@asdf.kooi.me
mafintosh
mathiasbuus@gmail.com
Estimated unpacked size across 15 packages.
168.9 kB
Includes dependencies.
11 direct · 1 outdated
^2.1.2
2.1.2
0.0.0
0.0.0
^7.0.0
7.0.1
^1.0.0
1.1.3
^2.0.0
2.0.0
^1.0.4
1.0.4
^2.0.0
3.0.0
^1.0.2
1.0.5