// src/editor/plugins/top-toolbar-button/index.js
subscribe( () => {
setTimeout( () => {
const toolbar = document.querySelector( '.edit-post-header-toolbar' )
...
}, 100 )
} )
Fires on every wp.data store change (every keystroke/selection); each fire schedules a setTimeout doing 2–3 querySelectors. Unthrottled; timeouts stack.
Note: This issue only exists in Gutenberg
Recommendation: debounce + MutationObserver on the toolbar instead of a global store subscription.
Fires on every wp.data store change (every keystroke/selection); each fire schedules a
setTimeoutdoing 2–3querySelectors. Unthrottled; timeouts stack.Note: This issue only exists in Gutenberg
Recommendation: debounce +
MutationObserveron the toolbar instead of a global store subscription.