File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ class JobProvider extends Component {
2929 register : PropTypes . func . isRequired ,
3030 get : PropTypes . func . isRequired ,
3131 getRehydrate : React . PropTypes . func . isRequired ,
32+ removeRehydrate : React . PropTypes . func . isRequired ,
3233 } ) . isRequired ,
3334 } ;
3435
@@ -48,6 +49,9 @@ class JobProvider extends Component {
4849 delete this . rehydrateState . jobs [ id ]
4950 return rehydration
5051 } ,
52+ removeRehydrate : ( id ) => {
53+ delete this . rehydrateState . jobs [ id ]
54+ } ,
5155 } ,
5256 }
5357 }
Original file line number Diff line number Diff line change @@ -39,8 +39,9 @@ export default function withJob(config) {
3939 register : PropTypes . func . isRequired ,
4040 get : PropTypes . func . isRequired ,
4141 getRehydrate : React . PropTypes . func . isRequired ,
42+ removeRehydrate : React . PropTypes . func . isRequired ,
4243 } ) ,
43- }
44+ } ;
4445
4546 constructor ( props , context ) {
4647 super ( props , context )
@@ -58,9 +59,7 @@ export default function withJob(config) {
5859 }
5960
6061 // node
61- return serverMode === 'defer'
62- ? false
63- : this . resolveWork ( this . props )
62+ return serverMode === 'defer' ? false : this . resolveWork ( this . props )
6463 }
6564
6665 componentWillMount ( ) {
@@ -83,6 +82,10 @@ export default function withJob(config) {
8382 if ( ! this . state . completed ) {
8483 this . resolveWork ( this . props )
8584 }
85+
86+ if ( this . context . jobs && env === 'browser' ) {
87+ this . context . jobs . removeRehydrate ( id )
88+ }
8689 }
8790
8891 componentWillUnmount ( ) {
You can’t perform that action at this time.
0 commit comments