1.0.1 • Published 8 years ago
async-interaction v1.0.1
Asynchronous interaction
Fixed M53 warning on microtask.
Invoking 'alert()' during microtask execution is deprecated and will be removed
in M53, around September 2016. See
https://www.chromestatus.com/features/5647113010544640 for more details.
Installation
npm install async-interaction
Usage
// ES5
var asyncAlert = require('async-interaction').asyncAlert;
// ES6
import { asyncAlert } from 'async-interaction';
// Some asynchronous action
request.then(res => {
if (res.somethingWrong) {
asyncAlert('Error!');
}
})
Documentation
asyncAlert
var asyncAlert = require('async-interaction').asyncAlert;
asyncAlert('Error!');
asyncConfirm
var asyncConfirm = require('async-interaction').asyncConfirm;
asyncConfirm('OK?', res => {
console.log('Answer is' + res);
});
asyncPrompt
var asyncPrompt = require('async-interaction').asyncPrompt;
asyncConfirm('What is your name?', res => {
console.log('Your name is ' + name);
});