Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public stopObservingResource(path: string): void {
path = normalizeResourcePath(path);
// remove observer
const observerUrl = path.startsWith(this.requestBase) ? path : `${this.requestBase}${path}`;
const index = this.observedPaths.indexOf(observerUrl);
if (index === -1) return;
coap.stopObserving(observerUrl);
this.observedPaths.splice(index, 1);
}
return new Subscription(() => { coaps.stopObserving(form.href); complete(); });
}