Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.31 KB

README.md

File metadata and controls

40 lines (30 loc) · 1.31 KB

next-root-dispatch

Shortcut for window.dispatchEvent.

version license size download

installation

yarn add @jswork/next-root-dispatch

usage

import '@jswork/next-root-dispatch';

// original usage
window.dispatchEvent(new CustomEvent('resize'));
window.dispatchEvent(new CustomEvent('my-event', { detail: { foo: 'bar' } }));

// shortcut usage
nx.rootDispatch('resize');
nx.rootDispatch('my-event', { foo: 'bar' });

license

Code released under the MIT license.