Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
chromed
/
wp-content
/
plugins
/
extendify
/
src
/
Launch
/
hooks
:
useSitePlugins.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
import { getSitePlugins } from '@launch/api/DataApi'; import { useSiteProfile } from '@launch/hooks/useSiteProfile'; import { useUserSelectionStore } from '@launch/state/user-selections'; import useSWR from 'swr'; export const useSitePlugins = ({ disableFetch = false } = {}) => { const { loading, siteProfile } = useSiteProfile(); const { siteQA } = useUserSelectionStore(); const params = { key: 'site-plugins', siteProfile, siteQA, }; const { data, error } = useSWR( loading || disableFetch ? null : params, getSitePlugins, ); return { sitePlugins: data, error, loading: !data && !error }; };