File tree Expand file tree Collapse file tree 3 files changed +23
-19
lines changed Expand file tree Collapse file tree 3 files changed +23
-19
lines changed Original file line number Diff line number Diff line change 121121
122122 for ( i = 0 ; i < functionsToWrap . length ; i ++ ) {
123123 originals [ functionsToWrap [ i ] ] = store [ functionsToWrap [ i ] ] ;
124- store [ functionsToWrap [ i ] ] = function ( ) {
125- var args = arguments ;
126- if ( ! $rootScope . $$phase ) {
127- return $rootScope . $apply ( function ( ) {
128- return originals [ functionsToWrap [ i ] ] . apply ( store , args ) ;
129- } ) ;
130- }
131- return originals [ functionsToWrap [ i ] ] . apply ( store , args ) ;
132- } ;
124+ store [ functionsToWrap [ i ] ] = ( function ( name ) {
125+ return function ( ) {
126+ var args = arguments ;
127+ if ( ! $rootScope . $$phase ) {
128+ return $rootScope . $apply ( function ( ) {
129+ return originals [ name ] . apply ( store , args ) ;
130+ } ) ;
131+ }
132+ return originals [ name ] . apply ( store , args ) ;
133+ } ;
134+ } ) ( functionsToWrap [ i ] ) ;
133135 }
134136
135137 return store ;
Original file line number Diff line number Diff line change 111111
112112 for ( i = 0 ; i < functionsToWrap . length ; i ++ ) {
113113 originals [ functionsToWrap [ i ] ] = store [ functionsToWrap [ i ] ] ;
114- store [ functionsToWrap [ i ] ] = function ( ) {
115- var args = arguments ;
116- if ( ! $rootScope . $$phase ) {
117- return $rootScope . $apply ( function ( ) {
118- return originals [ functionsToWrap [ i ] ] . apply ( store , args ) ;
119- } ) ;
120- }
121- return originals [ functionsToWrap [ i ] ] . apply ( store , args ) ;
122- } ;
114+ store [ functionsToWrap [ i ] ] = ( function ( name ) {
115+ return function ( ) {
116+ var args = arguments ;
117+ if ( ! $rootScope . $$phase ) {
118+ return $rootScope . $apply ( function ( ) {
119+ return originals [ name ] . apply ( store , args ) ;
120+ } ) ;
121+ }
122+ return originals [ name ] . apply ( store , args ) ;
123+ } ;
124+ } ) ( functionsToWrap [ i ] ) ;
123125 }
124126
125127 return store ;
You can’t perform that action at this time.
0 commit comments