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

@rt-tools/store

v0.3.1

Published

Signal-based state management for Angular with Redux DevTools support

Readme

@rt-tools/store

npm Angular License

Signal-based state management for Angular with a message bus and Redux DevTools support. Part of the rt-tools workspace.

Installation

pnpm add @rt-tools/store
# or
npm install @rt-tools/store

@rt-tools/core and @rt-tools/utils come along as dependencies.

Features

BaseStoreService

Synchronous state management with Angular Signals.

import { Injectable } from '@angular/core';
import { BaseStoreService, IStoreConfig } from '@rt-tools/store';

interface CounterState {
    count: number;
}

type CounterAction = 'INCREMENT' | 'DECREMENT';

@Injectable({ providedIn: 'root' })
export class CounterStore extends BaseStoreService<CounterState, CounterAction> {
    constructor() {
        super({ count: 0 }, { name: 'CounterStore', devTools: true });
    }

    increment(): void {
        this.patchState(state => ({ ...state, count: state.count + 1 }), 'increment');
    }

    decrement(): void {
        this.patchState(state => ({ ...state, count: state.count - 1 }), 'decrement');
    }
}

BaseAsyncStoreService

Extended store for async operations with loading states.

import { Injectable } from '@angular/core';
import { BaseAsyncStoreService, BASE_INITIAL_STATE, IStateBase } from '@rt-tools/store';

interface UsersState extends IStateBase.Async {
    users: User[];
}

const INITIAL_STATE: UsersState = {
    ...BASE_INITIAL_STATE.ASYNC,
    users: [],
};

@Injectable({ providedIn: 'root' })
export class UsersStore extends BaseAsyncStoreService<UsersState, string> {
    constructor() {
        super(INITIAL_STATE, { name: 'UsersStore', devTools: true });
    }

    loadUsers(): void {
        this.startLoading();
        this.http.get<User[]>('/api/users').pipe(
            tap(users => {
                this.patchState(s => ({ ...s, users }), 'setUsers');
                this.setLoadingSuccess();
            }),
            catchError(error => this.setLoadingFailure(error))
        ).subscribe();
    }
}

Typing the failure

The failure methods (handleError, set*Failure, set*FailureVoid) carry whatever the transport reports as an error. The store never inspects it, so the third type parameter defaults to unknown and the base class stays independent of the transport.

Declare it to get a typed failure argument:

interface TransportFailure {
    code: number;
    reason: string;
}

@Injectable({ providedIn: 'root' })
export class UsersStore extends BaseAsyncStoreService<UsersState, string, TransportFailure> {
    // handleError(error?: TransportFailure, callbackFn?: () => void): void
    // setLoadingFailure(error: TransportFailure, config?: ISetPropertiesConfig): Observable<never>
}

The failure is rethrown untouched by set*Failure, so downstream catchError receives the original object.

Selectors

// In component
readonly loading = this.store.loading;
readonly users = computed(() => this.store.store().users);

// Template
@if (loading()) {
    <spinner />
} @else {
    @for (user of users(); track user.id) {
        <user-card [user]="user" />
    }
}

Redux DevTools

Enable DevTools in config:

super(INITIAL_STATE, {
    name: 'MyStore',
    devTools: true  // or { maxAge: 100, trace: true }
});

Requirements

| Requirement | Version | | ----------------- | --------- | | Angular | ^22.0.0 | | RxJS | ^7.8.0 | | @rt-tools/core | ^0.2.0 | | @rt-tools/utils | ^0.2.0 |

The package pulls in @angular/core and rxjs only; nothing here touches @angular/common/http, which is what lets the failure type stay transport-agnostic.

License

Apache-2.0 © Yauheni Krumin