File tree Expand file tree Collapse file tree 4 files changed +21
-6
lines changed Expand file tree Collapse file tree 4 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " reshow" ,
3
- "version" : " 0.13.0-beta.20 " ,
3
+ "version" : " 0.13.0-beta.21 " ,
4
4
"description" : " Flux Reducer Present Library" ,
5
5
"main" : " ./build/cjs/src/index.js" ,
6
6
"module" : " ./build/es/src/index.js" ,
61
61
"build:es:src" : " BABEL_ENV=es babel src -d build/es/src --root-mode upward" ,
62
62
"build:es:ui" : " BABEL_ENV=es babel ui -d build/es/ui --root-mode upward" ,
63
63
"build" : " npm run clean && npm run build:cjs && npm run build:es" ,
64
- "mocha" : " mocha -r jsdom-global/register 'build/cjs/**/__tests__/*.js'" ,
64
+ "mochaFor" : " mocha -r jsdom-global/register" ,
65
+ "mocha" : " npm run mochaFor -- 'build/cjs/**/__tests__/*.js'" ,
65
66
"test" : " npm run build && npm run mocha" ,
66
67
"format" : " prettier-eslint --write '**/src/**/*.js' '**/ui/**/*.jsx'" ,
67
68
"prepublishOnly" : " npm run test"
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Global Store use in calculateState
3
+ * when themePath and global path not sync will rollback to use prev state.
4
+ *
5
+ * https://github.com/react-atomic/reshow/blob/master/packages/reshow-return/src/returnOptions.js#L55-L63
6
+ */
7
+
1
8
export const globalStore = { } ;
Original file line number Diff line number Diff line change @@ -50,19 +50,26 @@ class Reshow extends PureComponent {
50
50
}
51
51
52
52
getPath ( ) {
53
- return this . resetGlobalPath ( ) ;
53
+ const { themePath, defaultThemePath} = this . props ;
54
+ return this . resetGlobalPath ( ) || themePath || defaultThemePath ;
54
55
}
55
56
57
+ /**
58
+ * @see globalStore https://github.com/react-atomic/reshow/blob/master/src/stores/globalStore.js
59
+ */
56
60
resetGlobalPath ( path ) {
57
61
if ( path ) {
58
62
setTimeout ( ( ) => dispatch ( { themePath : path } ) ) ;
59
63
} else {
60
- path = pageStore . getThemePath ( ) || this . props . themePath ;
64
+ path = pageStore . getThemePath ( ) ;
61
65
}
62
66
globalStore . path = path ;
63
67
return globalStore . path ;
64
68
}
65
69
70
+ /**
71
+ * @see globalStore https://github.com/react-atomic/reshow/blob/master/src/stores/globalStore.js
72
+ */
66
73
getGlobalPath ( ) {
67
74
return globalStore . path ;
68
75
}
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ describe('Test Section', () => {
116
116
setTimeout ( ( ) => {
117
117
expect ( wrap . el . getAttribute ( 'name' ) ) . to . equal ( 'test' ) ;
118
118
done ( ) ;
119
- } ) ;
119
+ } , 10 ) ;
120
120
} ) ;
121
121
122
122
it ( 'not pass name if child already have name' , done => {
@@ -173,6 +173,6 @@ describe('Test Section', () => {
173
173
expect ( uObj . el1 . getAttribute ( 'name' ) ) . to . be . null ;
174
174
expect ( uObj . el2 . getAttribute ( 'name' ) ) . to . equal ( 'test2' ) ;
175
175
done ( ) ;
176
- } ) ;
176
+ } , 10 ) ;
177
177
} ) ;
178
178
} ) ;
You can’t perform that action at this time.
0 commit comments