react-query-external-sync
Version:
A tool for syncing React Query state to an external Dev Tools
36 lines • 1.17 kB
JavaScript
/**
* Centralized storage query keys for all storage hooks
* This ensures consistency across MMKV, AsyncStorage, and SecureStorage hooks
* and allows easy modification of the base storage key in one place
*/
export const storageQueryKeys = {
/**
* Base storage key - change this to update all storage-related queries
*/
base: () => ['#storage'],
/**
* MMKV storage query keys
*/
mmkv: {
root: () => [...storageQueryKeys.base(), 'mmkv'],
key: (key) => [...storageQueryKeys.mmkv.root(), key],
all: () => [...storageQueryKeys.mmkv.root(), 'all'],
},
/**
* AsyncStorage query keys
*/
async: {
root: () => [...storageQueryKeys.base(), 'async'],
key: (key) => [...storageQueryKeys.async.root(), key],
all: () => [...storageQueryKeys.async.root(), 'all'],
},
/**
* SecureStorage query keys
*/
secure: {
root: () => [...storageQueryKeys.base(), 'secure'],
key: (key) => [...storageQueryKeys.secure.root(), key],
all: () => [...storageQueryKeys.secure.root(), 'all'],
},
};
//# sourceMappingURL=storageQueryKeys.js.map