A collection of small, reusable reactive building blocks for modern Angular (v20+) applications. The focus is on simple, well-typed composables and effects built around signals that you can drop into real projects with minimal ceremony.
- Fully tree shakeable: Only take what you want
- Strongly typed
- Transform signals: debounce, throttle, track previous values, and derive state.
- Observe the browser environment: respond to media queries, window size changes, and document visibility.
- Work with router state as signals: access route parameters, query parameters, fragments, and route data.
- Synchronize side effects safely: keep URL query parameters and local storage in sync with application state, and log changes during development.
- Work in progress. The primitives are not published yet; treat this repository as a source of copy‑and‑paste utilities or consume the library locally.
- Install dependencies:
npm install- Run the Documentation site for live examples:
npm run start- Build the library:
npm run build- Run tests:
npm run test- Develop documentation locally:
npm run docs:devprojects/angular-reactive-primitives— library source and primitivesprojects/documentation-site— Documentation sitescripts— internal scripts used to compile docs and generate routes
-
Create a
.doc.mdfile next to your library source file:projects/angular-reactive-primitives/src/lib/ composables/ my-feature/ my-feature.composable.ts my-feature.doc.md ← Create this -
Write your documentation in markdown (see
DOC_TEMPLATE.mdfor format) -
Run the build command:
npm run build:docs
-
The system automatically:
- Compiles your
.doc.mdinto a component inprojects/documentation-site/src/app/pages/ - Scans all generated components
- Generates route definitions in
generated-doc-routes.ts
- Compiles your
# Compile markdown to components
npm run compile:docs
# Compile + dev server
npm run docs:dev
# Compile + production build
npm run docs:buildprojects/
├── angular-reactive-primitives/
│ └── src/lib/
│ └── composables/
│ └── use-my-feature/
│ ├── use-my-feature.composable.ts # Implementation
│ └── use-my-feature.doc.md # Documentation
│
└── documentation-site/
└── src/app/
├── app.routes.ts # Routes (manual)
└── pages/
└── composables/
└── use-my-feature-page.component.ts # Generated!
- Angular 20+
- MIT