Skip to content

Commit

Permalink
Merge pull request michalsnik#232 from epoberezhny/refactoring
Browse files Browse the repository at this point in the history
Update elements.js
  • Loading branch information
michalsnik authored May 13, 2018
2 parents 836dbc0 + 722a98d commit 50909d8
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/js/helpers/elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@
*/
const createArrayWithElements = function (elements) {
elements = elements || document.querySelectorAll('[data-aos]');
let finalElements = [];

[].forEach.call(elements, function(el, i) {
finalElements.push({
node: el
});
});

return finalElements;
return Array.prototype.map.call(elements, node => ({ node }));
};

export default createArrayWithElements;

0 comments on commit 50909d8

Please sign in to comment.