1.0.0-beta.0 • Published 7 years ago

rxact-debugger v1.0.0-beta.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

npm version CircleCI master Coveralls github branch

Debugger for Rxact.

screenshot

Installation

  yarn add rxact
  yarn add rxact-debugger --dev

Usage

There are two ways:

1. Install as a plugin

  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()

2. Enhance StateStream

  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

API

plugin(options)

  plugin(options: {
    start?: boolean | Array<stateStreamName: string>,
  })

Return a StateStream plugin.

  • options: An object contain options.

    PropertyTypeDescriptionDefault
    startbool/arraystart 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)

  decorator(options: {
    start: ?boolean | Array<stateStreamName: string>,
  })

Return a function for wrapping StateStream.

  • options: As same as plugin's options.

stateStream.debugger

  stateStream.debugger: {
    start: Function,
    stop: Function,
  }

An debugger object, contains start and stop function.

  • start: start logging.
  • stop: stop logging.

License

MIT

1.0.0-beta.0

7 years ago

0.6.4

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.0

7 years ago

0.5.0

7 years ago

0.4.5

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago