PluginProbe
Extendify / trunk
Extendify vtrunk
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / src / Shared / lib / wp.js

wp.js in Extendify trunk, at src/Shared/lib/wp.js

17 lines 499 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { select, subscribe } from '@wordpress/data';
2 export const whenEditorIsReady = () => {
3 return new Promise((resolve) => {
4 const unsubscribe = subscribe(() => {
5 // This will trigger after the initial render blocking, before the window load event
6 // This seems currently more reliable than using __unstableIsEditorReady
7 if (
8 select('core/editor').isCleanNewPost() ||
9 select('core/block-editor').getBlockCount() > 0
10 ) {
11 unsubscribe();
12 resolve();
13 }
14 });
15 });
16 };
17