Skip to content

Commit 33350a9

Browse files
committed
Updating arrow functions to use parens as per airbnb style guide
1 parent 70998ab commit 33350a9

File tree

5 files changed

+34
-34
lines changed

5 files changed

+34
-34
lines changed

source/includes/_debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
```javascript
66
(WIAPI => {
77
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
8-
API.subscribe('page-load-v1', ev => {
8+
API.subscribe('page-load-v1', (ev) => {
99
if (ev.payload.searchPage) {
1010
API.log('My integration has loaded and this is a search results page.');
1111
}

source/includes/_events.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ To receive data for events, you must opt-in to event subscriptions. Each event i
212212
```javascript
213213
(WIAPI => {
214214
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
215-
API.subscribe('page-load-v1', ev => {
215+
API.subscribe('page-load-v1', (ev) => {
216216
API.log(ev);
217217
});
218218
})(window.DDC.API);
@@ -222,7 +222,7 @@ To receive data for events, you must opt-in to event subscriptions. Each event i
222222
Parameter Name | Example Value | Parameter Type
223223
-------------- | -------------- | --------------
224224
`event-id` | `page-load-v1` | `String`
225-
`callback` | `ev => { API.log(ev); }` | `function`
225+
`callback` | `(ev) => { API.log(ev); }` | `function`
226226

227227
> This event passes the standard <a href="#page-event">Page Event</a> object to your callback function.
228228
@@ -235,7 +235,7 @@ The page load event is useful to determine the context of the current page. By m
235235
```javascript
236236
(WIAPI => {
237237
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
238-
API.subscribe('dealership-info-v1', ev => {
238+
API.subscribe('dealership-info-v1', (ev) => {
239239
API.log(ev);
240240
});
241241
})(window.DDC.API);
@@ -245,7 +245,7 @@ The page load event is useful to determine the context of the current page. By m
245245
Parameter Name | Example Value | Parameter Type
246246
-------------- | -------------- | --------------
247247
`event-id` | `dealership-info-v1` | `String`
248-
`callback` | `ev => { API.log(ev); }` | `function`
248+
`callback` | `(ev) => { API.log(ev); }` | `function`
249249

250250
> This event passes the standard <a href="#dealership-info-event">Dealership Info Event</a> object to your callback function.
251251
@@ -258,7 +258,7 @@ The dealership info event is useful if you need to know the name and address of
258258
```javascript
259259
(WIAPI => {
260260
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
261-
API.subscribe('vehicle-shown-v1', ev => {
261+
API.subscribe('vehicle-shown-v1', (ev) => {
262262
API.log(ev);
263263
});
264264
})(window.DDC.API);
@@ -267,7 +267,7 @@ The dealership info event is useful if you need to know the name and address of
267267
Parameter Name | Example Value | Parameter Type
268268
-------------- | -------------- | --------------
269269
`event-id` | `vehicle-shown-v1` | `String`
270-
`callback` | `ev => { API.log(ev); }` | `function`
270+
`callback` | `(ev) => { API.log(ev); }` | `function`
271271

272272
> This event passes the standard <a href="#vehicle-event">Vehicle Event</a> object to your callback function.
273273
@@ -282,7 +282,7 @@ On a vehicle deals page, a single event is fired because you are viewing a singl
282282
```javascript
283283
(WIAPI => {
284284
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
285-
API.subscribe('vehicle-data-updated-v1', data => {
285+
API.subscribe('vehicle-data-updated-v1', (data) => {
286286
API.log(data.payload.pageData); // Outputs the Page Data object to the console.
287287
API.log(data.payload.vehicleData); // Outputs the updated Vehicle Data object to the console.
288288
});
@@ -292,7 +292,7 @@ On a vehicle deals page, a single event is fired because you are viewing a singl
292292
Parameter Name | Example Value | Parameter Type
293293
-------------- | -------------- | --------------
294294
`event-id` | `vehicle-data-updated-v1` | `String`
295-
`callback` | `ev => { API.log(ev); }` | `function`
295+
`callback` | `(ev) => { API.log(ev); }` | `function`
296296

297297
> This event passes the standard <a href="#page-event">Page Event</a> object to your callback function as well as the full array of <a href="#vehicle-event">Vehicle Event</a> data objects.
298298

source/includes/_locations.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ See the <a href="#api-insert-name-callback-elem-meta">insert documentation</a> f
2222
```javascript
2323
(WIAPI => {
2424
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
25-
API.subscribe('page-load-v1', ev => {
25+
API.subscribe('page-load-v1', (ev) => {
2626
if (ev.payload.searchPage) {
2727
API.insert('vehicle-media', (elem, meta) => {
2828
const button = API.create('button', {
@@ -61,7 +61,7 @@ This element is positioned below the vehicle image area on vehicle search pages.
6161
```javascript
6262
(WIAPI => {
6363
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
64-
API.subscribe('page-load-v1', ev => {
64+
API.subscribe('page-load-v1', (ev) => {
6565
if (ev.payload.searchPage || ev.payload.detailPage) {
6666
API.insert('vehicle-badge', (elem, meta) => {
6767
if (meta.inventoryType !== 'used') {
@@ -106,7 +106,7 @@ This element is positioned below the vehicle tech specs area on vehicle search a
106106
```javascript
107107
(WIAPI => {
108108
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
109-
API.subscribe('page-load-v1', ev => {
109+
API.subscribe('page-load-v1', (ev) => {
110110
// Only execute the code on search results and vehicle details pages.
111111
if (ev.payload.searchPage || ev.payload.detailPage) {
112112
API.insert('vehicle-pricing', function (elem, meta) {
@@ -146,7 +146,7 @@ This element is positioned below the vehicle pricing area on vehicle search and
146146
```javascript
147147
(WIAPI => {
148148
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
149-
API.subscribe('page-load-v1', ev => {
149+
API.subscribe('page-load-v1', (ev) => {
150150
if (ev.payload.detailPage) {
151151
API.insert('vehicle-media-container', (elem, meta) => {
152152
const containerEl = document.createElement('div');
@@ -180,7 +180,7 @@ This element is the media gallery container on vehicle deals pages. Injecting in
180180
```javascript
181181
(WIAPI => {
182182
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
183-
API.subscribe('page-load-v1', ev => {
183+
API.subscribe('page-load-v1', (ev) => {
184184
if (ev.payload.searchPage || ev.payload.detailPage) {
185185
API.insert('primary-banner', (elem, meta) => {
186186
const img = document.createElement('img'),

source/includes/_methods.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```javascript
88
(WIAPI => {
99
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
10-
API.subscribe('event-name-and-version', event => {
10+
API.subscribe('event-name-and-version', (event) => {
1111
API.log(event);
1212
});
1313
})(window.DDC.API);
@@ -21,7 +21,7 @@ Please see the <a href="#event-subscriptions">specific event documentation</a> f
2121
```javascript
2222
(WIAPI => {
2323
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
24-
API.insertCallToAction('button', 'value-a-trade', meta => {
24+
API.insertCallToAction('button', 'value-a-trade', (meta) => {
2525
return {
2626
"type": "default",
2727
"href": "https://www.yourdomain.com/value-a-trade/?vin=" + meta.vin,
@@ -116,20 +116,20 @@ After creating the callback object, you must then return it for the API to creat
116116
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
117117

118118
// Receive a notification each time vehicle data is updated on the page (or a new page is loaded).
119-
API.subscribe('vehicle-data-updated-v1', ev => {
119+
API.subscribe('vehicle-data-updated-v1', (ev) => {
120120

121121
// Collect the VIN for each vehicle on the page in an array.
122-
API.utils.getAttributeForVehicles('vin').then(vins => {
122+
API.utils.getAttributeForVehicles('vin').then((vins) => {
123123
API.log("Calling service with these VINs: " + vins.join(','));
124124

125125
// Fetch data from your endpoint by supplying the list of VINs.
126126
fetch('https://www.yourdomain.com/api/endpoint-that-returns-json?vins=' + vins.join(','))
127-
.then(response => {
127+
.then((response) => {
128128
return response.json();
129129
})
130-
.then(serviceData => {
130+
.then((serviceData) => {
131131
// Now that you have your service data, you can determine whether or not to place a CTA for this vehicle on the page.
132-
API.insertCallToActionOnce('button', 'value-a-trade', meta => {
132+
API.insertCallToActionOnce('button', 'value-a-trade', (meta) => {
133133
if (serviceData.hasOwnProperty(meta.vin)) {
134134
return {
135135
"type": "default",
@@ -231,7 +231,7 @@ If you need to execute additional code before determining if you wish to insert
231231
(WIAPI => {
232232
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
233233
// Receive a notification each time vehicle data is updated on the page (or a new page is loaded).
234-
API.subscribe('vehicle-data-updated-v1', ev => {
234+
API.subscribe('vehicle-data-updated-v1', (ev) => {
235235
// Insert content into each vehicle location now present on the page.
236236
API.insertOnce('location-name', (elem, meta) => {
237237
API.log(elem); // The DOM element where markup may be inserted.
@@ -250,18 +250,18 @@ If you need to execute additional code before determining if you wish to insert
250250
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
251251

252252
// Receive a notification each time vehicle data is updated on the page (or a new page is loaded).
253-
API.subscribe('vehicle-data-updated-v1', ev => {
253+
API.subscribe('vehicle-data-updated-v1', (ev) => {
254254

255255
// Collect the VIN for each vehicle on the page in an array.
256-
API.utils.getAttributeForVehicles('vin').then(vins => {
256+
API.utils.getAttributeForVehicles('vin').then((vins) => {
257257
API.log("Calling service with these VINs: " + vins.join(','));
258258

259259
// Fetch data from your endpoint by supplying the list of VINs.
260260
fetch('https://www.yourdomain.com/api/endpoint-that-returns-json?vins=' + vins.join(','))
261-
.then(response => {
261+
.then((response) => {
262262
return response.json();
263263
})
264-
.then(serviceData => {
264+
.then((serviceData) => {
265265
// Now that you have your service data, you can determine whether or not to place content for this location on to the page.
266266
API.insertOnce('vehicle-badge', function (elem, meta) {
267267
// Verify my service has data for this vehicle

source/includes/_utilities.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ In addition to the event based system for working with sites, some utility metho
99
```javascript
1010
(WIAPI => {
1111
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
12-
API.subscribe('vehicle-data-updated-v1', data => {
12+
API.subscribe('vehicle-data-updated-v1', (data) => {
1313

1414
API.log(data.payload.pageData); // Logs the Page Data object
1515
API.log(data.payload.vehicleData); // Logs the updated Vehicle Data object
1616

17-
API.utils.getAttributeForVehicles('vin').then(vins => {
17+
API.utils.getAttributeForVehicles('vin').then((vins) => {
1818
// With the updated list of VINs, you could query your service
1919
// to determine which VINs are supported by your service before
2020
// placing relevant content such as buttons or iframes.
@@ -43,7 +43,7 @@ This can be used to obtain an array of attributes for the currently displayed ve
4343
showOnVDP: false,
4444
apiKey: "abcd12349876zyxw"
4545
}
46-
API.utils.getConfig(testConfig).then(config => {
46+
API.utils.getConfig(testConfig).then((config) => {
4747
// Output the configuration object for your integration (if defined).
4848
API.log(config);
4949
});
@@ -61,7 +61,7 @@ This fetches a JavaScript object of your integration's configuration for the cur
6161
```javascript
6262
(WIAPI => {
6363
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
64-
API.utils.getDealerData().then(dealerData => {
64+
API.utils.getDealerData().then((dealerData) => {
6565
// Logs the Dealership Info Event object for the current website.
6666
API.log(dealerData);
6767
});
@@ -77,7 +77,7 @@ This fetches the <a href="#dealership-info-event">Dealership Info Event object</
7777
```javascript
7878
(WIAPI => {
7979
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
80-
API.utils.getJwtForSite().then(jwtObject => {
80+
API.utils.getJwtForSite().then((jwtObject) => {
8181
API.log(jwtObject);
8282
// Returns a data structure like this:
8383
// {
@@ -97,7 +97,7 @@ This fetches an object containing a Java Web Token which can be used to secure/v
9797
```javascript
9898
(WIAPI => {
9999
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
100-
API.utils.getJwtForVehicles().then(jwtObject => {
100+
API.utils.getJwtForVehicles().then((jwtObject) => {
101101
API.log(jwtObject);
102102
// Returns a data structure like this:
103103
// {
@@ -117,7 +117,7 @@ This fetches an object containing the array of VINs on the current page and a co
117117
```javascript
118118
(WIAPI => {
119119
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
120-
API.utils.getPageData().then(pageData => {
120+
API.utils.getPageData().then((pageData) => {
121121
// Outputs the Page Data Object for the current page.
122122
API.log(pageData);
123123
});
@@ -162,7 +162,7 @@ Will return the following object:
162162
```javascript
163163
(WIAPI => {
164164
const API = new WIAPI('test-integration'); // Note: Replace 'test-integration' with your actual integration identifier.
165-
const config = API.utils.getVehicleData().then(vehicleData => {
165+
const config = API.utils.getVehicleData().then((vehicleData) => {
166166
// Outputs the current set of vehicle data.
167167
API.log(vehicleData);
168168
});

0 commit comments

Comments
 (0)