🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

neo-observable-input

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

neo-observable-input

Ergonomic, robust RxJS Observable inputs for Angular

1.0.0
latest
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created

Neo observable input

Ergonomic, robust RxJS Observable inputs for Angular

Background

See https://github.com/angular/angular/issues/5689

Similar to https://github.com/Futhark/ngx-observable-input and https://github.com/insidewhy/observable-input and https://github.com/insidewhy/observable-input, but works with type checking Angular inputs, and avoids the tree-shaking problems of decorators.

Install

npm i neo-observable-input

Usage

import { Component, OnChanges } from "@angular/core";
import { ObservableInputs } from "neo-observable-input";

@Component({ template: "" })
export class ExampleComponent implements OnChanges {
  private readonly inputs = new ObservableInputs();

  @Input()
  color: string;
  color$ = this.inputs.observe(() => this.color);

  @Input()
  count: number;
  count$ = this.inputs.observe(() => this.count);

  ngOnChanges() {
    this.inputs.onChanges();
  }
}

FAQs

Package last updated on 03 Aug 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