Debugger for Rxact.
yarn add rxact
yarn add rxact-debugger --dev
There are two ways:
import { setup, StateStream } from 'rxact'
import { plugin as rxactDebugger } from 'rxact-debugger'
setup({
Observable: /** Observable lib you like **/,
plugins: [rxactDebugger()],
})
const stream = new StateStream('stream', { name: 'rxact' })
stream.debugger.start() import { setup, StateStream } from 'rxact'
import { decorator as rxactDebugger } from 'rxact-debugger'
const EnhancedStateStream = decorator()(StateStream)
setup({
Observable: /** Observable lib you like **/,
StateStream: EnhancedStateStream,
})
const stream = new EnhancedStateStream('stream', { name: 'rxact' })
stream.debugger.start()And you can access state streams in browser developer console via:
window.rxactDebugger.user // assume you have a stateStream named user plugin(options: {
start?: boolean | Array<stateStreamName: string>,
})Return a StateStream plugin.
-
options: An object contain options.
Property Type Description Default start bool/array start logger default or not. If value is an array of name of state stream, it will only start logger of these state streams. false
decorator(options: {
start: ?boolean | Array<stateStreamName: string>,
})Return a function for wrapping StateStream.
- options: As same as plugin's options.
stateStream.debugger: {
start: Function,
stop: Function,
}An debugger object, contains start and stop function.
- start: start logging.
- stop: stop logging.
