[v1] $q.dialog() now returns a chainable object (with onOK/onCancel callbacks), not a promise. How to use promise with it?
-
Is there an option to let $q.dialog return a promise like it did in 0.17+ ? It is awkward to convert callbacks to promises and fit in the promise or async/await codes every time we use dialog.
-
Can you explain your use case some to understand your need for asynchronous confirmation or cancellation of qdialog? And not even knowing your use case, could you build a custom dialog component for whatever async dialog needs you have?
Scott
-
Something to get you started:
return new Promise((resolve, reject) => { this.$q.dialog(...).onOk(resolve).onCancel(reject) }
-
I am just referencing this issue here because they are related. I also liked the promises. But apparently this is for performance reasons. See here:
https://github.com/quasarframework/quasar/issues/4532#issuecomment-531502252