Skip to content

Instantly share code, notes, and snippets.

@jeserkin
Created August 15, 2019 12:54
Show Gist options
  • Save jeserkin/73958aca8ae9644763f84b247a8e3ecb to your computer and use it in GitHub Desktop.
Save jeserkin/73958aca8ae9644763f84b247a8e3ecb to your computer and use it in GitHub Desktop.
export class Bungo {
constructor(private service1: Sevice1,
private service2: Sevice2) {
}
findAllRowsBasedOnOtherRows(otherRows: string[]): string[] {
this.service1.findAllRows$()
.pipe(
flatMap((service1Rows: Service1Row[]) => {
return this.service2.finalAllRows$()
.pipe(
// filtering
map((/* some _input from previous operation/s */) => service1Rows.map(/* do something here based on _input */))
)
})
)
.subscribe((service1Rows: Service1Row[]) => {
// Ta da! Mutated Service1Rows[] based on some additional requested information
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment