Use the official WP JS hooks library [MAILPOET-2081]

This commit is contained in:
wxa
2019-05-22 14:49:02 +03:00
committed by M. Shull
parent b17543b88a
commit 5d98e0a16b
4 changed files with 36 additions and 12 deletions

8
assets/js/src/hooks.js Normal file
View File

@@ -0,0 +1,8 @@
import { createHooks } from '@wordpress/hooks';
// Make sure the hooks library is available globally
// because it is used in views (e.g. newsletter/editor.html)
window.wp = window.wp || {};
window.wp.hooks = window.wp.hooks || createHooks();
export default window.wp.hooks;