Skip to content

Commit 5271c2e

Browse files
committed
mwc prefix to props and methods
1 parent 86ee653 commit 5271c2e

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

.versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ [email protected]_1
55
66
77
8-
8+
99
1010

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
"type": "git",
1212
"url": "https://github.com/meteorwebcomponents/mixin.git"
1313
},
14-
"version": "1.0.21"
14+
"version": "1.0.24"
1515
}

mwc-mixin.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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

package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package.describe({
22
name: 'mwc:mixin',
3-
version: '1.0.23',
3+
version: '1.0.24',
44
summary: 'Reactive Data Mixin For Polymer',
55
git: "https://github.com/meteorwebcomponents/mixin.git",
66
documentation: "README.md"

0 commit comments

Comments
 (0)