-
Suggestion
-
Resolution: Won't Fix
Many JavaScript APIs support promises. For example, the context API supports the provision of a callback or using promises. However, AP.confluence operations only support callback.
AP.context.getContext(console.log); // OK AP.context.getContext().then(context => {console.log(JSON.stringify(context, null, 2))}); // OK AP.confluence.getContentProperty('editor', console.log); // OK AP.confluence.getContentProperty('editor').then(contentProperty => console.log(JSON.stringify(contentProperty, null, 2))); // NOT SUPPORTED
Providing support for promises will improve the clarity of code and provide support for error handling.