Wikiki / bulma-carousel

Display a carousel
MIT License
136 stars 99 forks source link

Fix "currentActiveItem" is read-only #25

Closed tr33m4n closed 6 years ago

tr33m4n commented 6 years ago

When attempting to compile this library with babel, the following error occurs:

{ SyntaxError: /Users/danieldoyle/Projects/Indigo White/Drupal/backend/sites/all/themes/indigo_white_base/node_modules/bulma-carousel/dist/bulma-carousel.js: "currentActiveItem" is read-only
  104 |     if (!currentActiveItem) {
  105 |       this.items[0].classList.add('is-active');
> 106 |       currentActiveItem = this.items[0];
      |       ^
  107 |     }
  108 |     const currentActiveItemPos = this.items.indexOf(currentActiveItem);

This is due to reassigning a const within an if statement. This PR defines currentActiveItem as let