@@ -7,13 +7,13 @@ License: BSD 3-Clause License
77( {
88 handleRestRequest : function ( component , request ) {
99
10- var helper = this ;
10+ const helper = this ;
1111
12- var defaultRequest = {
12+ const defaultRequest = {
1313 'method' : 'get'
1414 } ;
1515
16- var defaultHeaders = {
16+ const defaultHeaders = {
1717 'Content-Type' : 'application/json'
1818 } ;
1919
@@ -28,7 +28,7 @@ License: BSD 3-Clause License
2828
2929 handleFetchRequest : function ( component , request ) {
3030
31- var helper = this ;
31+ const helper = this ;
3232
3333 return helper . getPenpalChild ( ) . then ( $A . getCallback ( function ( child ) {
3434 return helper . makePenpalRequest ( 'fetch' , child , request ) ;
@@ -45,11 +45,11 @@ License: BSD 3-Clause License
4545 */
4646 getPenpalChild : function ( ) {
4747
48- var helper = this ;
48+ const helper = this ;
4949
5050 return new Promise ( function ( resolve , reject ) {
5151
52- var child = helper . _penpal . child ;
52+ let child = helper . _penpal . child ;
5353
5454 if ( child ) {
5555
@@ -58,12 +58,12 @@ License: BSD 3-Clause License
5858 } else {
5959
6060 // all time values in milliseconds
61- var timeout = 10000 ; // ten seconds
62- var pollFrequency = 500 ; // half a second
63- var startTime = new Date ( ) . getTime ( ) ;
64- var endTime = startTime + timeout ;
61+ const timeout = 10000 ; // ten seconds
62+ const pollFrequency = 500 ; // half a second
63+ const startTime = new Date ( ) . getTime ( ) ;
64+ const endTime = startTime + timeout ;
6565
66- var timerId = setInterval ( $A . getCallback ( function ( ) {
66+ const timerId = setInterval ( $A . getCallback ( function ( ) {
6767
6868 child = helper . _penpal . child ;
6969
@@ -76,7 +76,7 @@ License: BSD 3-Clause License
7676 } else {
7777
7878 // check if we have exceeded our timeout
79- var currentTime = new Date ( ) . getTime ( ) ;
79+ const currentTime = new Date ( ) . getTime ( ) ;
8080 if ( currentTime > endTime ) {
8181 clearInterval ( timerId ) ;
8282 reject ( 'LC_API: Timeout trying to establish connection to iframe' ) ;
@@ -141,11 +141,11 @@ License: BSD 3-Clause License
141141 */
142142 makeApexRequest : function ( component , actionName , params , options ) {
143143
144- var helper = this ;
144+ const helper = this ;
145145
146146 return new Promise ( function ( resolve , reject ) {
147147
148- var action = component . get ( actionName ) ;
148+ const action = component . get ( actionName ) ;
149149
150150 if ( params ) {
151151 action . setParams ( params ) ;
@@ -201,7 +201,7 @@ License: BSD 3-Clause License
201201/*
202202BSD 3-Clause License
203203
204- Copyright (c) 2018, Doug Ayers, douglascayers.com
204+ Copyright (c) 2018-2019 , Doug Ayers, douglascayers.com
205205All rights reserved.
206206
207207Redistribution and use in source and binary forms, with or without
0 commit comments