# extendify/1.17.1/src/Draft/util/util.js

Extendify, version 1.17.1. 18 lines.

- Page: https://pluginprobe.com/plugins/extendify/1.17.1/code/src/Draft/util/util.js
- Raw: https://pluginprobe.com/plugins/extendify/1.17.1/raw/src/Draft/util/util.js
- Modified: 2023-10-11T02:07:34+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/extendify/1.17.1/code/src/Draft/util/util.js#L10-L20`.

```javascript
import { select, subscribe } from '@wordpress/data';

export function whenEditorIsReady() {
	return new Promise((resolve) => {
		const unsubscribe = subscribe(() => {
			// This will trigger after the initial render blocking, before the window load event
			// This seems currently more reliable than using __unstableIsEditorReady
			if (
				select('core/editor').isCleanNewPost() ||
				select('core/block-editor').getBlockCount() > 0
			) {
				unsubscribe();
				resolve();
			}
		});
	});
}

```
