| 1 |
import apiFetch from '@wordpress/api-fetch'; |
| 2 |
import useSWRImmutable from 'swr/immutable'; |
| 3 |
|
| 4 |
const fetcher = (url: string) => apiFetch<boolean>({ path: url }); |
| 5 |
|
| 6 |
export const useCanEditHTML = () => { |
| 7 |
const { data } = useSWRImmutable<boolean>( |
| 8 |
'/code-block-pro/v1/can-save-html', |
| 9 |
fetcher, |
| 10 |
); |
| 11 |
// Consider it true until the request completes |
| 12 |
return data; |
| 13 |
}; |
| 14 |
|