Enhance AP.confluence operations to support promises

XMLWordPrintable

      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.

       

       

            Assignee:
            Unassigned
            Reporter:
            Dugald Morrow
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: