Godofbrowser / vuejs-dialog

A lightweight, promise based alert, prompt and confirm dialog
MIT License
351 stars 111 forks source link

The promise reject doesn't really make sense... #38

Open nicroto opened 6 years ago

nicroto commented 6 years ago

Especially when you use the dialog from an async function - you will have to make the call inside of a try-catch block or you get a false error within the console when you cancel the confirm operation (because of the unhandled reject call).

Godofbrowser commented 6 years ago

That's correct... Do you have any idea how this can be improved? I'm thinking of resolving the promise with a property that takes the value false on rejection instead of rejecting the promise... Do let me know if you have a better idea.

Thanks

superbiche commented 5 years ago

I think it's the correct way as it correspond to what the user did: say "false" to the question prompted.

paddotk commented 2 years ago

What is the reason the promise rejects with false? It seems to me that you'd reject a promise with either nothing or an error object. If it's not necessary, I'd suggest to remove the false from the rejection so we don't get a warning about an unhandled promise rejection.