Seeking assistance in creating an observable that retrieves data in a specific format.
getRootGroupNodes(): Observable<Group[]> {
return Observable.create(function(observer) {
var groups = [
{ groupName: "Group1" },
{ groupName: "Group2" }
]
observer.next(groups);
observer.complete();
});
}
Encountering issues when attempting to use it
this._loadGroupsSubscription = this._apiGroupService.getRootGroupNodes()
.retry(3)
.subscribe(
groups => {
// manipulate retrieved groups
},
err => { this._log.logMessage("failed to retrieve groups"); },
() => {
this._loadGroupsSubscription.unsubscribe();
}
);
Observing that this._loadGroupsSubscription
is returning as null
, resulting in an error when trying to unsubscribe from it. Any insights on what could be causing this issue? It seems like a fundamental aspect..