diff options
author | Corentin Mors <corentin.mors@dashlane.com> | 2019-12-26 18:41:39 +0300 |
---|---|---|
committer | Corentin Mors <corentin.mors@dashlane.com> | 2019-12-26 18:41:39 +0300 |
commit | c3da84c390624754d04b86b3ba6dddeebc921a08 (patch) | |
tree | 65f78b8880dc053e875a4d7a93ad7223f94913df /src | |
parent | 42c89a1c886b0fe8ef797600b1556d998c1c1c2f (diff) |
(Refactor) Remove unused array to chunk
Signed-off-by: Corentin Mors <corentin.mors@dashlane.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/ArrayChunk.js | 39 | ||||
-rw-r--r-- | src/views/Timeline.vue | 6 |
2 files changed, 0 insertions, 45 deletions
diff --git a/src/utils/ArrayChunk.js b/src/utils/ArrayChunk.js deleted file mode 100644 index ff212228..00000000 --- a/src/utils/ArrayChunk.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com> - * - * @author John Molakvoæ <skjnldsv@protonmail.com> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ - -const arrayRange = function(n) { - // Array.range(5) --> [0,1,2,3,4] - return Array.apply(null, Array(n)).map((x, i) => i) -} - -/** - * Split an array into chunks - * - * @param {Array} arr an array to split - * @param {number} count lenght of the chunk - * @returns {Array} - */ -export default function(arr = [], count = 5) { - return arrayRange(Math.ceil(arr.length / count)).map((x, i) => - arr.slice(i * count, i * count + count) - ) -} diff --git a/src/views/Timeline.vue b/src/views/Timeline.vue index 6bdac23d..6aa68ab6 100644 --- a/src/views/Timeline.vue +++ b/src/views/Timeline.vue @@ -52,7 +52,6 @@ import File from '../components/File' import VirtualGrid from '../components/VirtualGrid' import cancelableRequest from '../utils/CancelableRequest' -import arrayToChunk from '../utils/ArrayChunk' import GridConfigMixin from '../mixins/GridConfig' export default { @@ -100,11 +99,6 @@ export default { isEmpty() { return this.fileList.length === 0 }, - - // the list chunked in rows for the virtual list - chunkedList() { - return arrayToChunk(this.fileList, this.gridConfig.count) - }, }, watch: { |