PluginProbe
Extendify / 1.9.0
Extendify v1.9.0
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 0.7.0 All 126 releases
extendify / src / Draft / util / util.js

util.js in Extendify 1.9.0, at src/Draft/util/util.js

18 lines 602 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
3 export function whenEditorIsReady() {
4 return new Promise((resolve) => {
5 const unsubscribe = subscribe(() => {
6 // This will trigger after the initial render blocking, before the window load event
7 // This seems currently more reliable than using __unstableIsEditorReady
8 if (
9 select('core/editor').isCleanNewPost() ||
10 select('core/block-editor').getBlockCount() > 0
11 ) {
12 unsubscribe()
13 resolve()
14 }
15 })
16 })
17 }
18