File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,11 @@ function connect(mapStateToProps, mapDispatchToProps) {
34
34
this . setData ( mappedState )
35
35
}
36
36
37
+ const {
38
+ onLoad : _onLoad ,
39
+ onUnload : _onUnload ,
40
+ } = pageConfig
41
+
37
42
function onLoad ( options ) {
38
43
this . store = app . store ;
39
44
if ( ! this . store ) {
@@ -43,9 +48,15 @@ function connect(mapStateToProps, mapDispatchToProps) {
43
48
this . unsubscribe = this . store . subscribe ( handleChange . bind ( this , options ) )
44
49
handleChange . apply ( this )
45
50
}
51
+ if ( typeof _onLoad === 'function' ) {
52
+ _onLoad . call ( this , options )
53
+ }
46
54
}
47
55
48
56
function onUnload ( ) {
57
+ if ( typeof _onUnload === 'function' ) {
58
+ _onUnload . call ( this )
59
+ }
49
60
typeof this . unsubscribe === 'function' && this . unsubscribe ( )
50
61
}
51
62
You can’t perform that action at this time.
0 commit comments