@@ -4,12 +4,12 @@ mwcMixin = {
44 subsReady :{ type :Boolean , notify :true , value :true } ,
55
66 mwcData :Object ,
7- __handles :{ type :Array , value :[ ] } ,
8- __computations :{ type :Array , value :[ ] } ,
9- __computationsIds :{ type :Array , value :[ ] } ,
7+ __mwcHandles :{ type :Array , value :[ ] } ,
8+ __mwcComputations :{ type :Array , value :[ ] } ,
9+ __mwcComputationsIds :{ type :Array , value :[ ] } ,
1010 __mwcBin :{ type :Array , value :[ ] }
1111 } ,
12- setData ( data ) {
12+ _mwcSetData ( data ) {
1313 this . set ( "mwcData" , data ) ;
1414 } ,
1515 attached ( ) {
@@ -18,19 +18,19 @@ mwcMixin = {
1818 this . autorun ( mwcDataUpdate . bind ( null , this ) ) ;
1919 } ,
2020 detatched ( ) {
21- _ . each ( this . __computations , ( c ) => {
21+ _ . each ( this . __mwcComputations , ( c ) => {
2222 c . stop ( ) ;
2323 } ) ;
24- this . __computations = [ ] ;
25- this . __handles . forEach ( ( h ) => {
24+ this . __mwcComputations = [ ] ;
25+ this . __mwcHandles . forEach ( ( h ) => {
2626 h . stop ( ) ;
2727 } ) ;
2828 this . __mwcBin . forEach ( ( h ) => {
2929 h . stop ( ) ;
3030 } ) ;
3131
3232 } ,
33- cPush ( p , val ) {
33+ _mwcPush ( p , val ) {
3434 let prop = _ . clone ( this [ p ] ) ;
3535 prop . push ( val ) ;
3636 this . set ( p , prop ) ;
@@ -57,30 +57,30 @@ mwcMixin = {
5757 } ,
5858 autorun ( f ) {
5959 const cb = ( c ) => {
60- if ( ! _ . find ( this . __computationsIds , ( _id ) => {
60+ if ( ! _ . find ( this . __mwcComputationsIds , ( _id ) => {
6161 return _id == c . _id ;
6262 } ) ) {
63- this . cPush ( "__computationsIds ", c . _id ) ;
64- this . cPush ( "__computations ", c ) ;
63+ this . _mwcPush ( "__mwcComputationsIds ", c . _id ) ;
64+ this . _mwcPush ( "__mwcComputations ", c ) ;
6565 }
6666 f . bind ( this ) ( c ) ;
6767 }
6868 Tracker . autorun ( cb . bind ( this ) ) ;
6969
7070 } ,
7171 _removeSubs ( val ) {
72- const handles = _ . reject ( _ . clone ( this . __handles ) , ( h ) => {
72+ const handles = _ . reject ( _ . clone ( this . __mwcHandles ) , ( h ) => {
7373 if ( h . subscriptionId = val . subscriptionId ) {
7474 return true ;
7575 }
7676 } ) ;
77- this . cPush ( '__mwcBin' , val ) ;
78- this . set ( "__handles " , handles ) ;
77+ this . _mwcPush ( '__mwcBin' , val ) ;
78+ this . set ( "__mwcHandles " , handles ) ;
7979
8080 } ,
8181 subscribe ( ) {
8282 const handle = Meteor . subscribe . apply ( null , arguments ) ;
83- this . cPush ( "__handles ", handle ) ;
83+ this . _mwcPush ( "__mwcHandles ", handle ) ;
8484 this . _subsReady ( ) ;
8585 const afterSub = ( c ) => {
8686 if ( handle . ready ( ) ) {
@@ -94,8 +94,8 @@ mwcMixin = {
9494
9595 return handle ;
9696 } ,
97- _subsReady ( __h ) {
98- const isReady = _ . every ( this . __handles , ( sub ) => {
97+ _subsReady ( h ) {
98+ const isReady = _ . every ( this . __mwcHandles , ( sub ) => {
9999 return sub && sub . ready ( ) ;
100100 } ) ;
101101 this . set ( "subsReady" , isReady ) ;
@@ -119,12 +119,12 @@ const mwcDataUpdate = (element)=> {
119119
120120 if ( element . __mwcFirstRun ) {
121121 element . __mwcFirstRun = false ;
122- element . setData ( data ) ;
122+ element . _mwcSetData ( data ) ;
123123 return ;
124124 }
125125
126126 Tracker . afterFlush ( ( ) => {
127- element . setData ( data ) ;
127+ element . _mwcSetData ( data ) ;
128128 } ) ;
129129}
130130
0 commit comments