New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@mmuscat/angular-composition-api

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mmuscat/angular-composition-api

Composition model for reactive Angular applications.

latest
Source
npmnpm
Version
0.1309.0
Version published
Weekly downloads
2
-93.75%
Maintainers
1
Weekly downloads
 
Created
Source

Angular Composition API

Composition model for functional reactive Angular applications.

Features

  • Small bundle size (4kb min gzipped)
  • Minimal API
  • Granular change detection
  • Better-than OnPush performance
  • Optional Zone.js
  • Observable inputs and queries
  • Reactive two-way bindings
  • Composable components, directives and services
  • Composable providers
  • Composable subscriptions
  • Lifecycle hooks
  • Computed values
  • Automatic teardown
  • RxJS interop (v6 and v7)
  • Incrementally adoptable

What it looks like

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

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

   return {
      count,
   }
}

@Component({
   inputs: ["count"],
})
export class MyComponent extends ViewDef(setup) {}

Quick Start

Install via NPM

npm install @mmuscat/angular-composition-api

Install via Yarn

yarn add @mmuscat/angular-composition-api

Setup

Provide ZonelessEventManager in your root module. This is required for proper change detection in event handlers.

@NgModule({
   providers: [
      {
         provide: EventManager,
         useClass: ZonelessEventManager,
      },
   ],
})
export class AppModule {}

Api Reference

Read the docs

Keywords

Angular

FAQs

Package last updated on 14 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts