Skip to content

Commit

Permalink
randomize default beers
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-catignani committed Nov 26, 2023
1 parent 3147340 commit 4bd49cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/features/output/outputSlice.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
import beers from '../../data/beers2.json';
import beerRules from '../../data/beer_rules.json';
import { sample } from 'lodash-es';
import { sample, shuffle } from 'lodash-es';
import Fuse from 'fuse.js';
import { UploadManager } from '@bytescale/sdk';
import download from 'downloadjs';
Expand Down Expand Up @@ -162,7 +162,7 @@ const getDefaultBeersForLetter = (letter) => {
]
}

return fuseSearch(fuseSearchQuery, {scoreThreshold: 0.5})
return shuffle(fuseSearch(fuseSearchQuery, {scoreThreshold: 0.5}))
}

const fuseSearch = (query, {limit = 10, scoreThreshold = 0.5} = {}) => {
Expand Down

0 comments on commit 4bd49cc

Please sign in to comment.