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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ngx-signal-combinators

v0.0.3

Published

Tree-shakable signal combinators for Angular 20+.

Downloads

19

Readme

ngx-signal-combinators

npm version

Composable boolean helpers built on Angular 20+ signals. The library exports tree-shakable utilities that let you combine Signal<boolean> values just like boolean expressions, while maintaining full type safety and reactivity.

Installation

npm install ngx-signal-combinators

The package is designed for Angular 20+ applications that leverage the standalone APIs.

Usage

API surface

| Function | Description | | --- | --- | | and(...signals) | Returns a computed signal that is true when every source signal is currently true (empty input resolves to true). | | or(...signals) | Returns a computed signal that is true when any source signal is currently true (empty input resolves to false). | | not(signal) | Returns a computed signal that negates the current value of the supplied signal. | | pr(signal, predicate) | Returns a computed signal that runs the predicate against the current value of the supplied signal. |

Template example

Below are individual template snippets that demonstrate each helper (assuming the component exposes isSignedIn, hasPremium, isSuspended, searchTerm, and a predicate helper isNonEmpty as signals/functions):

and(...)

@if (and(isSignedIn, hasPremium)()) {
  <article class="premium-banner">
    Thanks for subscribing! Premium features unlocked.
  </article>
} @else {
  <article class="premium-banner--locked">Activate premium to unlock more features.</article>
}

not(...)

@if (not(isSuspended)()) {
  <aside class="account-status">Account in good standing.</aside>
} @else {
  <aside class="account-status--warning">Account currently suspended.</aside>
}

or(...)

@if (or(isSignedIn, hasPremium)()) {
  <section class="dashboard">Dashboard available.</section>
} @else {
  <section class="dashboard--locked">Sign in to access your dashboard.</section>
}

pr(...)

@if (pr(searchTerm, isNonEmpty)()) {
  <section class="search-results">
    Showing results for "{{ searchTerm() }}".
  </section>
} @else {
  <section class="search-results--empty">
    Enter a search term to see results.
  </section>
}

Testing

Unit tests are provided in tests/ngx-signal-combinators.spec.ts using Vitest. They verify every exported helper. Run them with:

npx vitest run

The tests assert that each computed signal reacts to updates emitted by the source signals. If you prefer a browser-like environment, enable the jsdom environment in your Vitest config.