-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/open 57: Openingsuren component (STIJ-238) #164
base: develop
Are you sure you want to change the base?
Conversation
…OPEN-57 # Conflicts: # components/_preview.twig
…OPEN-57 # Conflicts: # components/41-organisms/header/header.twig
"title": "Openinghours", | ||
"name": "openinghours", | ||
"status": "alpha", | ||
"preview": "@preview", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is necessary if you use the default preview.
element.innerHTML = data; | ||
}; | ||
|
||
var openinghours = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable is redundant
this.s = Object.assign({}, defaults, options); | ||
this.items = items; | ||
|
||
for (var i = 0; i < items.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try for(var i = items.length; i--;)
This will only calculate the length of your array once, plus comparing to zero is faster.
Only really matters for very big arrays, but it's a nice habit ;)
https://stackoverflow.com/questions/1340589/are-loops-really-faster-in-reverse
OpeningHours.prototype.constructRequest = function () { | ||
switch (this._current.dataset.type) { | ||
case 'open-now': | ||
return this.s.endpoint + '/api/v1/services/' + this._current.dataset.service + '/channels/' + this._current.dataset.channel + '/open-now'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd put these strings in a function variable, so it's easy to change version numbers etc.
Description
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: