Use lodash to get random element from array

pull/10616/head
Andrew Watkins 2017-09-21 15:24:06 -07:00
parent d238907f61
commit f19bd728e4
1 changed files with 3 additions and 4 deletions

View File

@ -1,3 +1,5 @@
import _ from 'lodash'
const emptyFunny = [
'Looks like you dont have any queries. Be a lot cooler if you did.',
'Create a query below. Go on, I dare ya!',
@ -5,7 +7,4 @@ const emptyFunny = [
'1) Create a query below \n2) Profit',
]
const getRandomInt = (min, max) =>
Math.floor(Math.random() * (max - min + 1)) + min
export const emptyGraphCopy = emptyFunny[getRandomInt(0, 3)]
export const emptyGraphCopy = _.sample(emptyFunny)