# give/4.16.9/src/Campaigns/Blocks/shared/hooks/usePostState.ts

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.9. 22 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.9/code/src/Campaigns/Blocks/shared/hooks/usePostState.ts
- Raw: https://pluginprobe.com/plugins/give/4.16.9/raw/src/Campaigns/Blocks/shared/hooks/usePostState.ts
- Modified: 2025-05-21T20:18:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.9/code/src/Campaigns/Blocks/shared/hooks/usePostState.ts#L10-L20`.

```typescript
import {useSelect} from '@wordpress/data';

/**
 * @since 4.3.0
 */
export default function usePostState(): { isSaving: boolean, isDisabled: boolean } {
    const isSaving = useSelect((select) => {
        // @ts-ignore
        return select('core/editor').isSavingPost<boolean>();
    }, []);

    const isDisabled = useSelect((select) => {
        // @ts-ignore
        return !select('core/editor').isEditedPostSaveable();
    }, []);

    return {
        isSaving,
        isDisabled
    }
}

```
