Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class StatsProvider {
private getSwitchedCellStrength(): Observable<number> {
return this.switch$
.switchMap((deviceId: string) =>
this.db
.list(this.paths.sensorStatList(deviceId, CELL_STRENGTH_KEY), {
query: {
orderByChild: 'datetime',
limitToLast: 1
}
})
.takeUntil(this.device.deviceChange$)
)
.filter((stats: Stat<any>[]) => stats != null)
.filter(stats => stats[0])
.map((stats): number => stats[0].val)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.