@mmuscat/angular-composition-api

Composition model for reactive Angular applications.


Keywords
Angular, RxJS, Composition API, Observable, Reactive, composition-api, reactive-programming, state-management
License
MIT
Install
npm install @mmuscat/angular-composition-api@0.1302.0

Documentation

Angular Composition API

Composition API and supporting libraries for writing functional Angular applications.

Learn more

function setup() {
   const service = inject(Service)
   const count = use(0)

   subscribe(count, () => {
      service.log(count.value)
   })

   return {
      count,
   }
}

RFC

This repository is a reference implementation for this RFC discussion.

Packages

Name Description
Core Composition model for writing functional reactive Angular applications.
Boundary Error Boundary and Suspense implementation for Angular.
Store State management library for Angular Composition API.
Resource Data fetching library for Angular Composition API.

Contributing

  1. Clone this repository.

  2. Run yarn inside the project root.

  3. Run ng test to ensure tests are passing.

  4. Run ng build [package] to build the library.

  5. Run ng link from dist/[package] and ng link @mmuscat/[package] to link the build files to your workspace

  6. Run ng serve to check the example application works.