All Projects → insidewhy → observable-input

insidewhy / observable-input

Licence: other
angular input properties as observable streams

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to observable-input

react-rxjs-flux
a small library for creating applications based on unidirectional data flow
Stars: ✭ 22 (-55.1%)
Mutual labels:  rxjs
rx-query
timdeschryver.github.io/rx-query/
Stars: ✭ 195 (+297.96%)
Mutual labels:  rxjs
rx react native starter kit
React Native/redux/observable/auth starter kit which include immutable, rxjs, auth0 integration
Stars: ✭ 20 (-59.18%)
Mutual labels:  rxjs
redis-patterns-console
An interactive (and reactive) console to try and go into the deep of Redis and its patterns!
Stars: ✭ 22 (-55.1%)
Mutual labels:  rxjs
react-rxjs
🔌 "Plug and play" for Observables in React Apps!
Stars: ✭ 36 (-26.53%)
Mutual labels:  rxjs
ngx-mobx
Mobx decorators for Angular Applications
Stars: ✭ 14 (-71.43%)
Mutual labels:  rxjs
ng-observe
Angular reactivity streamlined...
Stars: ✭ 65 (+32.65%)
Mutual labels:  rxjs
rxnode
Rxnode - a small and fast wrapper around the nodejs API using RxJS.
Stars: ✭ 24 (-51.02%)
Mutual labels:  rxjs
redrock
Typesafe, reactive redux
Stars: ✭ 14 (-71.43%)
Mutual labels:  rxjs
rxjs-excel
RxJS demo of a simple excel app
Stars: ✭ 24 (-51.02%)
Mutual labels:  rxjs
rxrest
Reactive rest library
Stars: ✭ 33 (-32.65%)
Mutual labels:  rxjs
firebase-ignite
Firebase PWA Boilerplate
Stars: ✭ 12 (-75.51%)
Mutual labels:  rxjs
bassdrum
reactive, type safe components with preact and rxjs.
Stars: ✭ 44 (-10.2%)
Mutual labels:  rxjs
angular-model-pattern-example
Model pattern for Angular (2, 4, ...), manage and share your state with simple services using RxJS Subjects and Observables
Stars: ✭ 37 (-24.49%)
Mutual labels:  rxjs
cookbook
VueJS + NodeJS Evergreen Cookbook
Stars: ✭ 440 (+797.96%)
Mutual labels:  rxjs
reactive-angular-workshop
This is the source code for the world's greatest Reactive Angular Workshop.
Stars: ✭ 30 (-38.78%)
Mutual labels:  rxjs
mst-effect
💫 Designed to be used with MobX-State-Tree to create asynchronous actions using RxJS.
Stars: ✭ 19 (-61.22%)
Mutual labels:  rxjs
streamkit
My streaming overlay platform for YouTube https://bit.ly/3AvaoFz and Twitch https://bit.ly/37xUPAM
Stars: ✭ 15 (-69.39%)
Mutual labels:  rxjs
proc-that
proc(ess)-that - easy extendable ETL tool for Node.js. Written in TypeScript.
Stars: ✭ 25 (-48.98%)
Mutual labels:  rxjs
ngx-tree
A derived version of angular-tree-component without mobx, better performance.
Stars: ✭ 13 (-73.47%)
Mutual labels:  rxjs

Installation

npm install -S observable-input

or

yarn add observable-input

Usage

import { Component, Input } from '@angular/core'
import { Observable } from 'rxjs'
import { ObservableInput } from 'observable-input'

@Component({
  templateUrl: './some-component.html',
  selector: 'app-some-component',
})
class SomeComponent {
  @Input() @ObservableInput()
  private index: Observable<number>
}

It can be used like this with a non-observable input for index:

<app-some-component index="nonObservableValue"></app-some-component>

Details

This decorator works by replacing the input with a property, the getter returns a value with type Observable<T> while the setter expects a variable of type T. This introduces a few drawbacks:

  • While you should generally only be reading your input values and not setting them, the mismatch of types for the setter and getter here is still potentially a source of confusion.
  • For now the angular code (whether AOT compiled or not) only writes to a component's inputs (in this case via the setter) and never reads from them, if it did it would receive a value with type Observable<T> when it expects a value of type T.
  • The angular compiler does not type check the values passed to a component match the types of the @Input, if it did it would raise an error indicating that the input should be of type Observable<T> instead of T.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].