files/en-us/web/api/pressureobserver/unobserve/index.md
{{APIRef("Compute Pressure API")}}{{SeeCompatTable}}{{AvailableInWorkers("window_and_worker_except_service")}}{{securecontext_header}}
The unobserve() method of the {{domxref('PressureObserver')}} interface stops the pressure observer callback from receiving pressure records from the specified source.
unobserve(source)
source
None ({{jsxref("undefined")}}).
The following example shows how to stop observing the "gpu" source after the observer previously observed both, the "cpu" and "gpu" sources.
const observer = new PressureObserver(callback);
observer.observe("cpu");
observer.observe("gpu");
// Callback now gets called whenever the pressure state changes for 'cpu' or 'gpu'.
observer.unobserve("gpu");
// Callback now only gets called whenever the pressure state changes for 'cpu'.
{{Specifications}}
{{Compat}}