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
Correct typos and strengthen type safety in state hooks
Fix misspelled type and option names, improve type annotations,
and add runtime type guards to make state and action handling safer.
- Rename TranformerFn to TransformerFn and update all references in
fetch, useQuery, useQueries, useQueryState to reflect the corrected
type name.
- Rename throwSlientError to throwSilentError across mutation paths
(mutate and useMutation) to fix the typo and ensure error handling
uses the intended flag.
- Improve client state typing:
- Initialize rootState with a precise generic and undefined initial
value to avoid unsafe casting.
- Make uiState derived access nullable-safe via optional chaining.
- Remove an unnecessary setupListeners call during construction.
- Replace endpoints: (_: any) => ({}) with endpoints: () => ({}) for a
clearer, simpler signature.
- Add isObjectWithActionName and isObjectWithCommand runtime type guards
and start refactoring extractActionName to use safer checks.
These changes fix bugs caused by misspellings, reduce unsafe casts,
and add guards to avoid runtime errors when handling external options.
0 commit comments