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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ui-router-signals

v0.3.0

Published

TC39 Signals for UI-Router: a framework-agnostic signal mirror of the router's current state

Readme

ui-router-signals

codecov

TC39 Signals for UI-Router: a framework-agnostic signal mirror of the router's current state, through signal-polyfill.

The design is tracked in #1157. lit-ui-router-signals builds Lit controllers on it.

Installation

npm install ui-router-signals signal-polyfill

Features

  • RouterSignals: one RouteSnapshot per successful transition, in a Signal.State. route, current, params and transition are read-only Signal.Computeds over it, and the tracked includes() answers for that settled snapshot, not the live router. pending and error sit beside the snapshot, fed by one onStart hook: pending is the newest transition still in flight, set on start and cleared when that transition settles, however it settles, unless a newer one has started; error is that transition's RejectType.ERROR rejection, cleared when the next transition starts. One instance (and its transition hooks) per router via RouterSignals.for(router).
  • RouteTypes: an empty interface an app or a registry fills in by module augmentation. Its snapshot member types route, so a snapshot whose includes(name) is a type predicate narrows current and params. Empty, route holds a RouteSnapshot.
  • watchSelection: watches a selector through a Signal.Computed and hands each new value to a callback, once synchronously and then in a microtask after any source changes. A watcher's notify callback may not read signals, so it schedules the read; several synchronous sets deliver one change.

Loading and error state

import { RouterSignals, watchSelection } from 'ui-router-signals';

const signals = RouterSignals.for(router);

const stop = watchSelection(
  () =>
    signals.pending.get() ? 'loading' : signals.error.get() ? 'error' : 'idle',
  undefined,
  (status) => (document.body.dataset.routeStatus = status),
);

Dependencies

@uirouter/core and signal-polyfill are peer dependencies. lit and lit-ui-router are not, and the bundleProbe claim in package.json holds the entry free of them. Every signal consumer in a bundle needs the same copy of signal-polyfill; two copies keep two separate signal graphs.