Whalebird-desktop-client-ma.../src/renderer/store/TimelineSpace/Contents.ts

81 lines
2.1 KiB
TypeScript
Raw Normal View History

import SideBar, { SideBarModuleState } from './Contents/SideBar'
2019-04-13 12:11:11 +02:00
import Home, { HomeState } from './Contents/Home'
import Notifications, { NotificationsState } from './Contents/Notifications'
import Favourites, { FavouritesState } from './Contents/Favourites'
2020-08-24 12:33:55 +02:00
import Bookmarks, { BookmarksState } from './Contents/Bookmarks'
import Local, { LocalState } from './Contents/Local'
import Public, { PublicState } from './Contents/Public'
import Search, { SearchModuleState } from './Contents/Search'
2018-04-09 14:10:25 +02:00
import Lists from './Contents/Lists'
import Hashtag, { HashtagModuleState } from './Contents/Hashtag'
import DirectMessages, { DirectMessagesState } from './Contents/DirectMessages'
import FollowRequests, { FollowRequestsState } from './Contents/FollowRequests'
import Mentions, { MentionsState } from './Contents/Mentions'
import { Module, MutationTree, ActionTree } from 'vuex'
import { RootState } from '@/store'
export type ContentsState = {
loading: boolean
}
type ContentsModule = {
SideBar: SideBarModuleState
Home: HomeState
Notifications: NotificationsState
Mentions: MentionsState
DirectMessages: DirectMessagesState
Favourites: FavouritesState
2020-08-24 12:33:55 +02:00
Bookmarks: BookmarksState
Local: LocalState
Public: PublicState
Search: SearchModuleState
Hashtag: HashtagModuleState
FollowRequests: FollowRequestsState
}
export type ContentsModuleState = ContentsModule & ContentsState
const state = (): ContentsState => ({
loading: false
})
export const MUTATION_TYPES = {
CHANGE_LOADING: 'changeLoading'
}
const mutations: MutationTree<ContentsState> = {
[MUTATION_TYPES.CHANGE_LOADING]: (state, loading: boolean) => {
state.loading = loading
}
}
const actions: ActionTree<ContentsState, RootState> = {
changeLoading: ({ commit }, loading) => {
commit(MUTATION_TYPES.CHANGE_LOADING, loading)
}
}
const Contents: Module<ContentsState, RootState> = {
namespaced: true,
state: state,
modules: {
SideBar,
Home,
Notifications,
Favourites,
2020-08-24 12:33:55 +02:00
Bookmarks,
Local,
2018-11-01 18:01:04 +01:00
DirectMessages,
2019-03-14 17:02:10 +01:00
Mentions,
Public,
2018-04-15 13:22:27 +02:00
Search,
2018-04-09 14:10:25 +02:00
Lists,
Hashtag,
FollowRequests
},
mutations: mutations,
actions: actions
}
export default Contents