Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commite918c49

Browse files
committed
refactor import files
1 parent381fd65 commite918c49

File tree

9 files changed

+116
-146
lines changed

9 files changed

+116
-146
lines changed

‎pages/communities/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { request } from 'graphql-request'
44
import{GRAPHQL_ENDPOINT}from'../../config'
55

66
importGAWraperfrom'../../components/GAWraper'
7-
importinitRootStorefrom'../../stores'
7+
importinitRootStorefrom'../../stores/init'
88
importThemeWrapperfrom'../../containers/ThemeWrapper'
99
importMultiLanguagefrom'../../containers/MultiLanguage'
1010
importSidebarfrom'../../containers/Sidebar'

‎pages/communities/tags.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { request } from 'graphql-request'
44
import{GRAPHQL_ENDPOINT}from'../../config'
55

66
importGAWraperfrom'../../components/GAWraper'
7-
importinitRootStorefrom'../../stores'
7+
importinitRootStorefrom'../../stores/init'
88
importThemeWrapperfrom'../../containers/ThemeWrapper'
99
importMultiLanguagefrom'../../containers/MultiLanguage'
1010
importSidebarfrom'../../containers/Sidebar'

‎pages/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Provider } from 'mobx-react'
33
/* import { request } from 'graphql-request' */
44
/* import { GRAPHQL_ENDPOINT } from '../config' */
55

6-
importinitRootStorefrom'../stores'
6+
importinitRootStorefrom'../stores/init'
77
import{GAWraper,Footer}from'../components'
88

99
import{

‎pages/users.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { request } from 'graphql-request'
44
import{GRAPHQL_ENDPOINT}from'../config'
55

66
importGAWraperfrom'../components/GAWraper'
7-
importinitRootStorefrom'../stores'
7+
importinitRootStorefrom'../stores/init'
88
importThemeWrapperfrom'../containers/ThemeWrapper'
99
importMultiLanguagefrom'../containers/MultiLanguage'
1010
importSidebarfrom'../containers/Sidebar'

‎stores/RootStore/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import {
5050
SidebarStore,
5151
TypeWriterStore,
5252
AccountEditorStore,
53-
}from'../storeIndex'
53+
}from'../index'
5454

5555
/* eslint-disable no-unused-vars */
5656
constdebug=makeDebugger('S:rootStore')

‎stores/index.js‎

Lines changed: 71 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,71 @@
1-
/*
2-
* the entry of the App store
3-
*
4-
*/
5-
6-
// import { onAction } from 'mobx-state-tree'
7-
8-
importRootStorefrom'./RootStore'
9-
10-
letrootStore=null
11-
12-
constcreateRootStore=({ langSetup, ...restData})=>{
13-
returnRootStore.create({appLangs:langSetup, ...restData},{})
14-
}
15-
16-
functioninitRootStore({ langSetup, ...restData}){
17-
if(rootStore===null){
18-
rootStore=createRootStore({ langSetup, ...restData})
19-
}
20-
21-
rootStore.markState({
22-
...restData,
23-
})
24-
25-
returnrootStore
26-
}
27-
28-
exportdefaultinitRootStore
29-
30-
// not work, TODO
31-
/*
32-
if (module.hot) {
33-
if (module.hot.data && module.hot.data.rootStore) {
34-
// applySnapshot(module.hot.data.old, module.hot.data.rootStore)
35-
}
36-
module.hot.dispose(data => {
37-
// getSnapshot ...
38-
})
39-
}
40-
*/
1+
// domain store
2+
export{defaultasAccountStore}from'./AccountStore'
3+
export{defaultasUsersStore}from'./UsersStore'
4+
export{defaultasPostsStore}from'./PostsStore'
5+
6+
export{defaultasBodylayoutStore}from'./BodylayoutStore'
7+
export{defaultasApiLayoutStore}from'./ApiLayoutStore'
8+
export{defaultasSidebarStore}from'./SidebarStore'
9+
export{defaultasPreviewStore}from'./PreviewStore'
10+
export{defaultasDoraemonStore}from'./DoraemonStore'
11+
export{defaultasHeaderStore}from'./HeaderStore'
12+
13+
export{defaultasCurCommunity}from'./CurCommunity'
14+
15+
// banner store
16+
export{defaultasBannerStore}from'../containers/Banner/store'
17+
export{defaultasUsersBannerStore}from'../containers/UsersBanner/store'
18+
19+
export{
20+
defaultasCommunitiesBannerStore,
21+
}from'../containers/CommunitiesBanner/store'
22+
export{
23+
defaultasCommunityBannerStore,
24+
}from'../containers/CommunityBanner/store'
25+
26+
// contents store
27+
export{defaultasContentStore}from'../containers/Content/store'
28+
export{defaultasUsersContentStore}from'../containers/UsersContent/store'
29+
export{
30+
defaultasCommunitiesContentStore,
31+
}from'../containers/CommunitiesContent/store'
32+
export{
33+
defaultasCommunityContentStore,
34+
}from'../containers/CommunityContent/store'
35+
36+
// editors
37+
export{defaultasTagEditorStore}from'../containers/TagEditor/store'
38+
export{
39+
defaultasCommunityEditorStore,
40+
}from'../containers/CommunityEditor/store'
41+
42+
export{
43+
defaultasCategoryEditorStore,
44+
}from'../containers/CategoryEditor/store'
45+
export{
46+
defaultasPermissionEditorStore,
47+
}from'../containers/PermissionEditor/store'
48+
49+
// setter
50+
export{
51+
defaultasCategorySetterStore,
52+
}from'../containers/CategorySetter/store'
53+
54+
export{defaultasTagSetterStore}from'../containers/TagSetter/store'
55+
export{
56+
defaultasCommunitySetterStore,
57+
}from'../containers/CommunitySetter/store'
58+
export{defaultasThreadSetterStore}from'../containers/ThreadSetter/store'
59+
60+
// toolbox
61+
export{defaultasTypeWriterStore}from'../containers/TypeWriter/store'
62+
export{defaultasCommentsStore}from'../containers/Comments/store'
63+
export{
64+
defaultasAccountEditorStore,
65+
}from'../containers/AccountEditor/store'
66+
67+
// viewers store
68+
export{defaultasArticleViwerStore}from'../containers/ArticleViwer/store'
69+
export{
70+
defaultasAccountViewerStore,
71+
}from'../containers/AccountViewer/store'

‎stores/init.js‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* the entry of the App store
3+
*
4+
*/
5+
6+
// import { onAction } from 'mobx-state-tree'
7+
8+
importRootStorefrom'./RootStore'
9+
10+
letrootStore=null
11+
12+
constcreateRootStore=({ langSetup, ...restData})=>{
13+
returnRootStore.create({appLangs:langSetup, ...restData},{})
14+
}
15+
16+
functioninitRootStore({ langSetup, ...restData}){
17+
if(rootStore===null){
18+
rootStore=createRootStore({ langSetup, ...restData})
19+
}
20+
21+
rootStore.markState({
22+
...restData,
23+
})
24+
25+
returnrootStore
26+
}
27+
28+
exportdefaultinitRootStore
29+
30+
// not work, TODO
31+
/*
32+
if (module.hot) {
33+
if (module.hot.data && module.hot.data.rootStore) {
34+
// applySnapshot(module.hot.data.old, module.hot.data.rootStore)
35+
}
36+
module.hot.dispose(data => {
37+
// getSnapshot ...
38+
})
39+
}
40+
*/

‎stores/initIntroStore.js‎

Lines changed: 0 additions & 30 deletions
This file was deleted.

‎stores/storeIndex.js‎

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp