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

ngx-data-core

v0.0.2

Published

Shared base classes for the Service/State/Facade data-access pattern used across this Angular workspace's sibling projects (e.g. `bookmarks`, `characters`).

Readme

ngx-data-core

Shared base classes for the Service/State/Facade data-access pattern used across this Angular workspace's sibling projects (e.g. bookmarks, characters).

What's in here

  • StateService<T> (base-state.service.ts) — a signal-based state holder. Subclass it, call super(initialState), and use the protected updateState()/reset() methods plus the public state/loading/error signals.
  • BaseDataService<T> (base-data.service.ts) — a generic CRUD-over-HttpClient base. Subclass it and declare protected override readonly endpoint: string; you get getAll/getById/create/update/delete for free.
  • BaseFacade<T, State> (base-facade.service.ts) — extends StateService, adds createResource(), a thin wrapper around rxResource for building auto-reloading resources from reactive params.

None of these classes are Supabase-specific. The consuming app is expected to provide its own HttpClient interceptor (e.g. a PostgREST-rewrite interceptor) if it's talking to Supabase — see bookmarks/src/app/core/supabase/supabase-rest.interceptor.ts for a working example.

Usage

// my-entity-data.service.ts
@Injectable({ providedIn: 'root' })
export class MyEntityDataService extends BaseDataService<MyEntity> {
  protected override readonly endpoint = `${inject(AppConfigService).restUrl}/my_entity`;
}
// my-entity.facade.ts
interface MyEntityState {
  selectedId: string | null;
}

@Injectable({ providedIn: 'root' })
export class MyEntityFacade extends BaseFacade<MyEntity, MyEntityState> {
  constructor() {
    super({ selectedId: null });
  }
}

Building and consuming locally

This library isn't published to npm. Consuming projects reference a packed tarball, not the raw dist/ directory:

# in angular-data-lib/
ng build ngx-data-core
cd dist/ngx-data-core
npm pack   # produces ngx-data-core-<version>.tgz
// in the consuming project's package.json
"dependencies": {
  "ngx-data-core": "file:../angular-data-lib/dist/ngx-data-core/ngx-data-core-0.0.1.tgz"
}

Then run npm install in the consuming project.

Why a tarball and not a plain file:../.../dist/ngx-data-core directory reference: npm installs directory-style file: dependencies as a symlink. Since the symlink target lives outside the consumer's own directory tree, Node resolves bare imports like @angular/core from within the linked package relative to its real path (angular-data-lib/node_modules/@angular/core) instead of the consumer's node_modules/@angular/core — a classic dual-package hazard. In practice this made inject() calls inside BaseFacade/StateService throw NG0203 under the consumer's Vitest test runner (it worked fine in production builds, since esbuild's app bundling happened to dedupe it there, but broke under @angular/build:unit-test). Packing into a tarball makes npm extract a real, independent copy into the consumer's node_modules, resolving @angular/core the normal way.

Whenever this library changes: rebuild, re-pack (bump the version in projects/ngx-data-core/package.json if you want to avoid stale-tarball confusion), and re-run npm install in the consumer — there's no watch-mode wiring between the two repos yet.

Development

ng test ngx-data-core   # run the unit tests (Vitest)
ng build ngx-data-core  # build to dist/ngx-data-core