Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TODO: Fachlicher Service Namenslösung #15

Closed
yanosz opened this issue Mar 7, 2019 · 1 comment
Closed

TODO: Fachlicher Service Namenslösung #15

yanosz opened this issue Mar 7, 2019 · 1 comment

Comments

@yanosz
Copy link
Contributor

yanosz commented Mar 7, 2019

Idee:

import { Injectable } from '@angular/core';
import {MqttAdapterService} from './mqtt-adapter.service';
import {Observable} from 'rxjs';
import {filter, map} from 'rxjs/operators';
import {AggregatedName} from './model/aggregated/aggregated-name';

@Injectable({
providedIn: 'root'
})
export class NamesService {

constructor(private mqtt: MqttAdapterService) { }

public name(mac: string): Observable {
return this.mqtt.aggregatedNamesSubject().pipe(filter( (map, index) => {
return map.get(mac).name;
});
}

public updateName(mac: string, name: string){
this.mqtt.publishName(mac, name);
}
}

@yanosz
Copy link
Contributor Author

yanosz commented Mar 7, 2019

/o\

@yanosz yanosz closed this as completed Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant