From 7ab7605c220c665607844784ffbf21a030888f8e Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Sat, 8 Dec 2018 17:09:12 +0100 Subject: Revamp app loaders --- src/helpers/array-helpers.js | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/helpers/array-helpers.js (limited to 'src/helpers/array-helpers.js') diff --git a/src/helpers/array-helpers.js b/src/helpers/array-helpers.js new file mode 100644 index 000000000..ffb3b63dc --- /dev/null +++ b/src/helpers/array-helpers.js @@ -0,0 +1,4 @@ +export const shuffleArray = arr => arr + .map(a => [Math.random(), a]) + .sort((a, b) => a[0] - b[0]) + .map(a => a[1]); -- cgit v1.2.3-54-g00ecf