I am trying to get distinct values of a property in an observable array.
let pt$ = Observable.of([{planTypeID : 1, description : 'test 1'},
{planTypeID : 2, description : 'test 2'}]);
let planTypeIDs$ = pt$
.flatMap(a => a)
.map(a => a.planTypeID).distinct().toArray();
Is this the right way to do it in rxjs, or is there a better way?