Files
2018-04-10 14:51:52 +10:00

16 lines
413 B
JavaScript

const Prompt = function (){
let fn = null;
return {
now: function(text, okCallback, cancelCallback, type){
if(!fn){ return window.setTimeout(() => this.now(text, okCallback, cancelCallback, type), 50); }
fn(text, okCallback, cancelCallback, type);
},
subscribe: function(_fn){
fn = _fn;
}
};
};
export const prompt = new Prompt();