You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, sampleInterval is an option of the PressureObserver constructor. If I want to create several pressure observers, I guess my code would look like this:
In other APIs, for example for the PerformanceObserver, the options are on the observe method. If that would be the case for this API, I could write code like this:
Not sure if having multiple pressure observers is typical but I guess if I had multiple of them, I likely want to have different sources or options. I see that "cpu" is the only source and sampleInterval is the only option for now, though, so maybe this will only matter if this API offers more sources and more options in the future.
Indeed, the plan is to have more than one source in the future.
Also as you mentioned, in issue #213, the array of source was already proposed.
We will be adding sources and fixing #213 whenever we find reliable enough metrics to read for these sources.
I believe we used to have the options as part of the observe method, and I don't recall the reason why we moved it. Maybe for consistency with other API at that point.
I am not against moving it to the observe method. Potentially we could also do that later and have it overwrite what was set in the constructor.
Currently,
sampleInterval
is an option of thePressureObserver
constructor. If I want to create several pressure observers, I guess my code would look like this:In other APIs, for example for the
PerformanceObserver
, the options are on theobserve
method. If that would be the case for this API, I could write code like this:Not sure if having multiple pressure observers is typical but I guess if I had multiple of them, I likely want to have different sources or options. I see that "cpu" is the only source and
sampleInterval
is the only option for now, though, so maybe this will only matter if this API offers more sources and more options in the future.Even more future proof:
The text was updated successfully, but these errors were encountered: