Skip to content

Commit

Permalink
feat(project): add provisional stores for user, watchhistory, favorit…
Browse files Browse the repository at this point in the history
…es, config
  • Loading branch information
royschut committed Jun 10, 2021
1 parent 3b1d299 commit c5aa477
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/state/ConfigStore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Store } from 'pullstate';
import type { Config } from 'types/Config';

type ConfigStore = {
configLocation: string;
isLoading: boolean;
config: Config;
};

export const ConfigStore = new Store<ConfigStore>({
configLocation: '',
isLoading: false,
config: {
id: '',
siteName: '',
description: '',
footerText: '',
player: '',
assets: {},
content: [],
menu: [],
options: {
shelveTitles: true,
},
},
});
13 changes: 13 additions & 0 deletions src/state/FavoritesStore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Store } from 'pullstate';

type Favorite = {
mediaId: string;
};

type FavoritesStore = {
favorites: Favorite[];
};

export const FavoritesStore = new Store<FavoritesStore>({
favorites: [{ mediaId: '' }],
});
15 changes: 15 additions & 0 deletions src/state/UserStore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Store } from 'pullstate';

type User = {
name: string;
};

type UserStore = {
user: User;
};

export const UserStore = new Store<UserStore>({
user: {
name: '',
},
});
13 changes: 13 additions & 0 deletions src/state/WatchHistoryStore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Store } from 'pullstate';

type WatchHistoryItem = {
mediaId: string;
};

type WatchHistoryStore = {
watchHistory: WatchHistoryItem[];
};

export const WatchHistoryStore = new Store<WatchHistoryStore>({
watchHistory: [{ mediaId: '' }],
});

0 comments on commit c5aa477

Please sign in to comment.