Hello.
How can I make a modal window with Promise without the use of various frameworks?
On the Internet, for several days, I could not find an adequate example. (All examples on various bootstrap and their ilk. For my small home project, this is unnecessary.)
The task is simple:
- by pressing the button, the logic is executed, part of which is the “call” of the window with the input field (and its own internal logic) and two buttons - “ok & cancel”;
- It is necessary in the same piece of code back to get the result of the input.
Now everything is implemented via callback, but hell is going on there, I would like to use promises.
I am a little familiar with the promises themselves - ajax requests for them.
Thank you in advance.
new Promise(r=>func((...args)=>{ r(...args);}))plus variations with parameter passing. unless of course you now have half a Promise that you don’t know. - Grundy