Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
Merge pull request #16 from lemonde/marius-fix-memoize-youtube
Browse files Browse the repository at this point in the history
fix(youtube): retire le memoize qui ne fonctionne pas correctement (v3)
  • Loading branch information
mariusbrn authored Jul 4, 2018
2 parents 797545f + 10c9b81 commit 08ee696
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/providers/youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ var searchUrl = function searchUrl(query, token) {
return url;
};

var fetchVideo = _.memoize(function (videoId, part) {
var fetchVideo = function fetchVideo(videoId, part) {
return fetch(fetchUrl(videoId, part), { headers: provider.headers }).then(function (res) {
return res.json();
});
});
};

/**
* Convert duration ISO 8601 to seconds
Expand Down
5 changes: 2 additions & 3 deletions src/providers/youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ const searchUrl = (query, token) => {
return url;
};

const fetchVideo = _.memoize((videoId, part) =>
fetch(fetchUrl(videoId, part), { headers: provider.headers }).then(res => res.json())
);
const fetchVideo = (videoId, part) => fetch(fetchUrl(videoId, part), { headers: provider.headers })
.then(res => res.json());

/**
* Convert duration ISO 8601 to seconds
Expand Down

0 comments on commit 08ee696

Please sign in to comment.