npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jhoguet/rxjs-debugger

v0.0.3

Published

a debugger that enables you debug an rxjs stream

Downloads

5

Readme

#rxjs-debugger

:exclamation: Use with caution, this is still in the proof of concept phase and lacks adequate testing both in automated tests and in the wild.

Intent

The intent of this repo is to make it easier to debug streams in a running application.

Some of the driving goals are:

  1. You should not need to install any special tools / chrome extensions to debug the app
  2. You should not need to restart the app / put it into debug mode
  3. Debugging should do as little as possible until something asks for the debug info (delay as much as possible)
  4. Debugging should not be able to break the app
  5. You should be able to use the debugger to change state

Getting Started

npm i @jhoguet/rxjs-debugger

then in your index file

import { extendObservable } from '@jhoguet/rxjs-debugger';
import { Observable } from 'rxjs';

extendObservable(Observable);

// now can add debug points to any stream or get a debugger... see api below

Next Steps / How to help

  • explore options other than extending the Observable prototype, eg bind aka :: or a global getDebugger(forStream) instead of forStream.getDebugger()
  • research the risk of .source, is this a non-starter? are there better options?
  • catch up on todos
  • companion UI library for visualizing the stream
  • refactor to embrace fact that a subscription should be more first class than stream is, and that a subscription relies on 0 to many subscriptions (eg combineLatest and other aggregators)
  • refactor tests in debugOperator.tests.js to be index.tests.js
  • address memory leaks (eg in SubscriptionDebugger)

Stream Api

On any observable, there is now a debug operator.

###stream.debug(name :string, description :string)

| name | description | |--------|--------| | name | the name for this debug point in the stream | | description | a description to describe the value at this point in the stream |

stream.getDebugger(name :?string) :StreamDebugger

This will return the closest StreamDebugger to the stream.

StreamDebugger

debugger.nextUpstream(name :?string)

debugger.nextDownstream(name :?string)

You cannot go further downstream than the original stream on which .getDebugger() was called

debugger.getSubscriptions()

SubscriptionDebugger

debugger.trace()

returns an array of TimestampedValues for the most recent subscription for each debug in the observable stream.

debugger.setValue(value)

sets the value on observable

StreamDebuggerApi

api.getDebugger(stream :Observable, name :?string)

Next Steps / How to help

  • explore options other than extending the Observable prototype, eg bind aka :: or a global getDebugger(forStream) instead of forStream.getDebugger()
  • research the risk of .source, is this a non-starter? are there better options?
  • likely missing some documentation, what is missing? where is more depth needed?