mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-11-01 02:43:35 +08:00
16 lines
413 B
JavaScript
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();
|