Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fakeDatabase = {
- quizzes: [{
- id: v4(),
- title: 'Get started',
- text: 'hey',
- completed: true,
- hints: [{
- id: 1,
- text: 'Hint 1'
- }, {
- id: 2,
- text: 'Hint 2'
- }]
- }, {
- id: v4(),
- title: 'What are you waiting for?',
- text: 'ho',
- completed: true,
- hints: [{
- id: 3,
- text: 'Hint 3'
- }, {
- id: 4,
- text: 'Hint 4'
- }]
- }, {
- id: v4(),
- title: 'Remember! create more than you consume',
- text: 'let’s go',
- completed: false,
- hints: [{
- id: 5,
- text: 'Hint 5'
- }, {
- id: 6,
- text: 'Hint 6'
- }]
- }],
- };
- import { Schema, arrayOf } from 'normalizr';
- export const hint = new Schema('hints');
- export const quiz = new Schema('quizzes', {
- hints: [ hint ]
- });
- export const arrayOfQuiz = arrayOf(quiz);
- normalize(response, schema.arrayOfQuiz)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement