From 4e5e188e967f157ddb31d0b9386cae16ed0c7ca0 Mon Sep 17 00:00:00 2001 From: Doug Ayers Date: Sun, 28 Apr 2019 02:01:40 -0500 Subject: [PATCH] add fetch request example --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 11bca87..427b337 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,21 @@ Find the `` by its `aura:id` then call one of the request methods: // handle error })); + }, + + getDataFromGist: function( component, event, helper ) { + + component.find( 'lc_api' ).fetchRequest({ + 'url' : 'https://gist.githubusercontent.com/douglascayers/e96c53304dc78dc83e59a85753f29111/raw/sfdx-mass-action-scheduler-version.js', + 'options': {} + }).then( $A.getCallback( function( response ) { + // handle response + })).catch( $A.getCallback( function( err ) { + // handle error + })); + } + }) ```