uView Pro X's 8 Composables Kill the Most Repetitive uni-app x Page Work
Skipping these composables means re-solving the same timing, null-check, and platform-compat issues on every page; adopting them removes a whole class of subtle layout and gesture bugs from uni-app x projects.
Writing uni-app x pages forces developers to chase window dimensions, status bar offsets, safe area insets, gesture direction, and countdown drift, and to reconcile those values across App, H5, mini-programs, and HarmonyOS. uView Pro X's 8 composables pull that plumbing into a single import. They share a module-level data source with the library's own components, so a page's values line up with what `ux-tabbar` or `ux-safe-bottom` use internally.
Each composable targets a specific pain point. `useWindowInfo` refreshes at module load and again after mount to get accurate first-frame sizes; `useSafeArea` separates safe area insets from status bar height; `useRect` wraps `getBoundingClientRectAsync` and returns null when an element is absent; `useTouch` normalizes touch and mouse events via conditional compilation and locks gesture direction once a threshold is crossed. `useCountDown` bases its calculation on an end time, so background throttling doesn't erode accuracy; `useDebounce` and `useThrottle` cache factories by delay to avoid stale timers; `useDeviceInfo` captures device data once. All eight work without any `ux-*` component, so existing uni-app x projects can adopt them piecemeal.
A module-level singleton for window info prevents the classic one-page-two-heights bug, because all call sites share one ref.
The distinction between statusBarHeight and safeAreaInsets is a subtle source of misalignment on landscape iOS; splitting them into separate APIs forces developers to choose the right one.
Normalizing touch and mouse events with conditional compilation keeps gesture code identical across H5 and App, moving platform quirks into the library.
The countdown's use of endTime rather than decrement logic is a direct fix for background throttling; the timer's late firing only affects refresh rate, not accuracy.