Skip to content

Instantly share code, notes, and snippets.

@ezequieltejada
Last active November 15, 2022 16:28
Show Gist options
  • Save ezequieltejada/e17b9fdeb60bc11e5d00017ce5c28a44 to your computer and use it in GitHub Desktop.
Save ezequieltejada/e17b9fdeb60bc11e5d00017ce5c28a44 to your computer and use it in GitHub Desktop.
How to handle multiple asynchronous inputs
asyncInputsData$ = new BehaviorSubject(null);
/*****
* (13/11/2022) OLD... just use @Inputs
*****/
ngOnChanges(changes: SimpleChanges): void {
const obj = {};
Object.keys(changes).forEach(key => {
obj[key] = changes[key].currentValue;
});
this.asyncInputsData$.next({...this.consumerAndBrandId$.value, ...obj});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment