Created
May 7, 2019 15:34
-
-
Save scottmo/7898fa7d15ec74dd1c0b933d8113ae36 to your computer and use it in GitHub Desktop.
Revisions
-
scottmo created this gist
May 7, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ function createComponent(cmp, attributes) { return new Promise(function(resolve, reject) { function doCreateComponent() { $A.createComponent(cmpDef, attributes, function(newCmp, status, errorMsg) { if (newCmp && status === 'SUCCESS') { resolve(newCmp); } else if (status === 'ERROR') { reject(errorMsg); } else if (status === 'INCOMPLETE') { $A.getEvt('markup://force:showOfflineMessage').fire({ retryFunction: doCreateComponent }); } }); } doCreateComponent(); }); }