Skip to content

Commit

Permalink
some better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
justinbmeyer committed Jun 21, 2018
1 parent ff1d6df commit d7402c6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
22 changes: 18 additions & 4 deletions can/map/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,37 @@ var canMapBehavior = behavior("can/map",function(baseConnection){

// ### Setup store updates
if(this.Map[canSymbol.for("can.onInstanceBoundChange")]) {
this.Map[canSymbol.for("can.onInstanceBoundChange")](function canConnectMap_onInstanceBoundChange(instance, isBound){
var canConnectMap_onMapBoundChange = function (instance, isBound){
var method = isBound ? "addInstanceReference" : "deleteInstanceReference";
if(connection[method]) {
connection[method](instance);
}
})
}
//!steal-remove-start
Object.defineProperty(canConnectMap_onMapBoundChange, "name", {
value: canReflect.getName(this.Map) + " boundChange",
configurable: true
});
//!steal-remove-end
this.Map[canSymbol.for("can.onInstanceBoundChange")](canConnectMap_onMapBoundChange)
} else {
console.warn("can-connect/can/map is unable to listen to onInstanceBoundChange on the Map type")
}

if(this.List[canSymbol.for("can.onInstanceBoundChange")]) {
this.List[canSymbol.for("can.onInstanceBoundChange")](function(list, isBound){
var canConnectMap_onListBoundChange = function(list, isBound){
var method = isBound ? "addListReference" : "deleteListReference";
if(connection[method]) {
connection[method](list);
}
})
}
//!steal-remove-start
Object.defineProperty(canConnectMap_onListBoundChange, "name", {
value: canReflect.getName(this.List) + " boundChange",
configurable: true
});
//!steal-remove-end
this.List[canSymbol.for("can.onInstanceBoundChange")](canConnectMap_onListBoundChange);
} else {
console.warn("can-connect/can/map is unable to listen to onInstanceBoundChange on the List type")
}
Expand Down
2 changes: 1 addition & 1 deletion constructor/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ var constructorStore = connect.behavior("constructor/store",function(baseConnect
this._requestLists = {};
}

requests.on("end", function(){
requests.on("end", function onRequestsEnd_deleteStoreReferences(){
var id;
for(id in this._requestInstances) {
this.instanceStore.deleteReference(id);
Expand Down

0 comments on commit d7402c6

Please sign in to comment.