https://github.com/pauldraper/neo-observable-input
https://github.com/pauldraper/neo-observable-input
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/pauldraper/neo-observable-input
- Owner: pauldraper
- License: mit
- Created: 2021-07-13T16:27:52.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-03T16:39:38.000Z (almost 5 years ago)
- Last Synced: 2025-03-18T19:36:24.903Z (over 1 year ago)
- Language: TypeScript
- Size: 4.88 KB
- Stars: 15
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# 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
```ts
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();
}
}
```