notify-promise
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

notify-promise

Wrap Promise to support notify.

Install

npm install notify-promise

Usage

import NotifyPromise from 'notify-promise';
const promise = new NotifyPromise((resolve, reject, notify) => {
	notify('message 1');
	notify({ context: 'this is an object!' });
	resolve();
	notify('notify will not trigger when promise finished');
});
  
promise.then(() => {
	console.log('done');
}).notify((message, index) => {
	console.log(`[${index}] Message:`, message);
});
  
// 'message 1'
// { context: 'this is an object!' }
// 'done'

Readme

Keywords

none

Package Sidebar

Install

npm i notify-promise

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • zombiej