Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Feature/open 57: Openingsuren component (STIJ-238) #164

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

Jeroen005
Copy link
Contributor

@Jeroen005 Jeroen005 commented Nov 29, 2017

Description

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have updated the CHANGELOG accordingly.
  • I have read the CONTRIBUTING document.

@Jeroen005 Jeroen005 self-assigned this Nov 29, 2017
"title": "Openinghours",
"name": "openinghours",
"status": "alpha",
"preview": "@preview",
Copy link
Contributor

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 = {
Copy link
Contributor

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++) {
Copy link
Contributor

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';
Copy link
Contributor

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.

@meirege meirege changed the title Feature/open 57 Feature/open 57: Openingsuren component Jan 18, 2018
@meirege meirege added this to the 2.9.0 milestone Jan 18, 2018
@Jeroen005 Jeroen005 changed the title Feature/open 57: Openingsuren component Feature/open 57: Openingsuren component (STIJ-238) Jan 18, 2018
@meirege meirege modified the milestones: 2.9.0, 3.0.0 Jan 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants