/next-global-event

Window event for next.

Primary LanguageJavaScriptMIT LicenseMIT

next-global-event

Window event for next.

version license size download

installation

npm install -S @jswork/next-global-event

apis

api params description
on (name, handler) Attach event.
emit (name, data) Trigger event.

usage

import NxGlobalEvent from '@jswork/next-global-event';

// attach event
const res = NxGlobalEvent.on('panel:ok', (inEvent)=>{
  console.log('I am ok');
});

// dettach event
res.destroy();

// trigger event
NxGlobalEvent.emit('panel:ok', { ready: true });

license

Code released under the MIT license.