@@ -29,7 +29,7 @@ angular.module('angular-meteor.reactive', ['angular-meteor.reactive-scope']).fac
29
29
30
30
_handleCursor ( cursor , name ) {
31
31
if ( angular . isUndefined ( this . context [ name ] ) ) {
32
- this . _setValHelper ( cursor . fetch ( ) , name ) ;
32
+ this . _setValHelper ( name , cursor . fetch ( ) ) ;
33
33
}
34
34
else {
35
35
let diff = jsondiffpatch . diff ( this . context [ name ] , cursor . fetch ( ) ) ;
@@ -66,7 +66,7 @@ angular.module('angular-meteor.reactive', ['angular-meteor.reactive-scope']).fac
66
66
67
67
_handleNonCursor ( data , name ) {
68
68
if ( angular . isUndefined ( this . context [ name ] ) ) {
69
- this . _setValHelper ( data , name ) ;
69
+ this . _setValHelper ( name , data ) ;
70
70
}
71
71
else {
72
72
if ( ( ! _ . isObject ( data ) && ! _ . isArray ( data ) ) ||
@@ -82,24 +82,17 @@ angular.module('angular-meteor.reactive', ['angular-meteor.reactive-scope']).fac
82
82
}
83
83
84
84
helpers ( props ) {
85
- let fns = { } ;
86
- let vals = { } ;
87
-
88
85
_ . each ( props , ( v , k ) => {
89
86
if ( _ . isFunction ( v ) )
90
- fns [ k ] = v ;
87
+ this . _setFnHelper ( k , v ) ;
91
88
else
92
- vals [ k ] = v ;
89
+ this . _setValHelper ( k , v ) ;
93
90
} ) ;
94
91
95
- // note that variable helpers are set before function helpers
96
- _ . each ( vals , this . _setValHelper . bind ( this ) ) ;
97
- _ . each ( fns , this . _setFnHelper . bind ( this ) ) ;
98
-
99
92
return this ;
100
93
}
101
94
102
- _setValHelper ( v , k ) {
95
+ _setValHelper ( k , v ) {
103
96
this . propertiesTrackerDeps [ k ] = new Tracker . Dependency ( ) ;
104
97
v = _ . clone ( v ) ;
105
98
@@ -118,7 +111,7 @@ angular.module('angular-meteor.reactive', ['angular-meteor.reactive-scope']).fac
118
111
} ) ;
119
112
}
120
113
121
- _setFnHelper ( fn , k ) {
114
+ _setFnHelper ( k , fn ) {
122
115
this . stoppables . push ( Tracker . autorun ( ( comp ) => {
123
116
let data = fn . apply ( this . context ) ;
124
117
0 commit comments