-
Notifications
You must be signed in to change notification settings - Fork 8
Sample State
Harsh edited this page Sep 18, 2017
·
3 revisions
{
entities: {
company: {
// The project with type `company` that currentUser belongs to
id: 10,
name: 'Johns Homemade Dough',
description: 'Important information for all employees'
teamMembers: [1,2,3,5,10,12,21]
},
teams: {
// All projects with type 'team' that currentUser belongs to
12: {
id: 12,
name: 'Executives',
description: 'C-level administration',
teamMembers: [3,10,21]
},
15: {
id: 15,
name: 'Finance',
description: 'Handling finances of the company',
teamMembers: [1,2]
},
18: {
id: 18,
name: 'Software'
description: 'The software developers',
teamMembers: [5,12],
}
},
projects: {
// All projects with type 'project' that currentUser belongs to
21: {
id: 21,
name: 'Build company website',
description: 'Web development team with Execs working on new website',
teamMembers: [3,5,10,12,21]
// if currently opened
messages: [12,43],
todolists: [3,5],
events: [2,10]
},
},
users: {
1:{
id: 1,
name: 'Fake Name',
avatar_url: 'img/....'
},
2:{
id: 2,
name: 'Fake Name',
avatar_url: 'img/....'
},
3:{
id: 3,
name: 'Fake Name',
avatar_url: 'img/....'
},
5:{
id: 5,
name: 'Fake Name',
avatar_url: 'img/....'
},
10:{
id: 10,
name: 'Fake Name',
avatar_url: 'img/....'
},
12:{
id: 12,
name: 'Fake Name',
avatar_url: 'img/....'
},
21:{
id: 21,
name: 'John Doe',
avatar_url: 'img/....'
}
},
messages: {
// Loaded on Message Board page
12: {
title: 'Do we want to use bootstrap?',
type: 'poll',
author_id: '12',
// if currently viewing message
comments: [2,4]
}
43: {
title: 'Make sure to update your gitignore files',
type: 'fyi',
author_id: '21',
}
}
todolists: {
3: {
id: 3,
title: 'Backend Auth',
todos:[1,2]
},
5: {
id: 5,
title: 'Frontend Auth',
todos:[5,7]
}
},
todos: {
1:{
id: 1,
title: 'Create Users and Session controllers',
author_id: '5',
assignedTo: [3,12],
done: 'false'
},
2:{
id: 2,
title: 'Create validations',
author_id: '5',
assignedTo: [3],
done: 'true'
},
5:{
id: 5,
title: 'Create protected routes',
author_id: 10,
assignedTo: [10],
done: 'false'
},
7:{
id: 7,
title: 'Create auth routes',
author_id: 10,
assignedTo: [5],
done: 'false'
},
}
events: {
2: {
id: 2,
title: 'Boss\'s birthday',
start_date: '2017-10-10 00:00:00 PST'
end_date: '2017-10-10 23:59:59 PST'
},
10: {
id: 10,
title: 'Company anniversary',
start_date: '2017-18-10 00:00:00 PST'
end_date: '2017-19-10 00:00:00 PST'
}
},
comments: {
// comments loaded only for the current view
2: {
id: 2,
body: 'I like bootstrap a lot!',
author_id: 5
},
4: {
id: 4,
body: 'Lets use vanilla, bootstrap is too heavy',
author_id: 10
}
}
},
session: {
currentUser: {
id: 5,
name: 'John Doe',
email: 'john@doe.com'
}
}
}