All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.cjs.react-utils.useFetchNeetoApps.useFetchNeetoApps.js.map Maven / Gradle / Ivy

Go to download

A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.

There is a newer version: 4.12.3
Show newest version
{"version":3,"file":"useFetchNeetoApps.js","names":["_neetoCist","require","_usePersistedQuery","_interopRequireDefault","_neeto_apps","_constants","_query","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","useFetchNeetoApps","options","_globalProps$user","scopedQueryKey","concat","QUERY_KEYS","NEETO_APPS_LIST","globalProps","user","id","_ref","usePersistedQuery","getCache","data","modifiedAt","expired","Date","now","NEETO_APPS_LIST_STALE_TIME","neetoAppsApi","fetch","staleTime","enabled","isNotPresent","_default","exports"],"sources":["../../../../src/react-utils/useFetchNeetoApps/useFetchNeetoApps.js"],"sourcesContent":["import { isNotPresent } from \"neetocist\";\nimport usePersistedQuery from \"react-utils/usePersistedQuery\";\n\nimport neetoAppsApi from \"./apis/neeto_apps\";\n\nimport { NEETO_APPS_LIST_STALE_TIME } from \"../constants\";\nimport { QUERY_KEYS } from \"../constants/query\";\n\nconst useFetchNeetoApps = options => {\n  const scopedQueryKey = [\n    `${QUERY_KEYS.NEETO_APPS_LIST}-${globalProps.user?.id}`,\n  ];\n\n  const { data, modifiedAt } = usePersistedQuery.getCache(scopedQueryKey) || {};\n  const expired = modifiedAt <= Date.now() - NEETO_APPS_LIST_STALE_TIME;\n\n  return usePersistedQuery(scopedQueryKey, neetoAppsApi.fetch, {\n    staleTime: NEETO_APPS_LIST_STALE_TIME,\n    enabled: expired || isNotPresent(data),\n    ...options,\n  });\n};\n\nexport default useFetchNeetoApps;\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,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