About useSupported computed properties #3473
Alfred-Skyblue
started this conversation in
General
Replies: 1 comment
-
This was added for SSR support, because certain features are not supported when server rendering, but are on the client, and the value needs to be able to change. See the PR (#1800) and commit (81d9225) for more info. Would whatever you are thinking of fit into this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In
useSupported
, a computed value is returned, which is often used to determine whether the browser supports a particular API. However, whether a browser supports a specific API is determined at the time of browser rendering and does not change during runtime due to some reasons. Therefore, in many cases, it should not be a computed property. Should we consider adding an option to return it as a regular value instead of a computed one?For instance,
useMutationObserver
is determined at the browser's initialization whether it supportsMutationObserver
vueuse/packages/core/useMutationObserver/index.ts
Line 27 in aca6a79
Beta Was this translation helpful? Give feedback.
All reactions