Last active
January 9, 2024 15:50
-
-
Save Jpoliachik/41c6033a3405a00d8c69cc0f2c02edcd to your computer and use it in GitHub Desktop.
Ignite Trivia App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
import shuffle from "lodash.shuffle" | |
... | |
... | |
export const QuestionModel = types | |
... | |
.views((self) => ({ | |
get allAnswers() { | |
return shuffle([ | |
...self.incorrectAnswers, | |
...(self.correctAnswer ? [self.correctAnswer] : []), | |
]) | |
}, | |
})) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment