From: Mike Taylor Date: Fri, 1 May 2015 20:52:36 +0000 (+0100) Subject: Towards MKWS-64. X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=644bd9209856efc5e28996920d760597e61ccce1;p=mkws-moved-to-github.git Towards MKWS-64. New (incomplete) function handleChanges(), compares old and new state objects to determine what's changed ... but doesn't yet act on it. --- diff --git a/src/mkws-team.js b/src/mkws-team.js index c688f76..73dd2f9 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -114,6 +114,16 @@ mkws.makeTeam = function($, teamName) { return x; } + that.handleChanges = function(oldState, newState) { + for (var key in newState) { + if (newState.hasOwnProperty(key) && + (!oldState || newState[key] != oldState[key])) { + that.warn("changed property " + key + ": '" + oldState[key] + "' -> '" + newState[key] + "'"); + } + } + }; + + // The following PubSub code is modified from the jQuery manual: // http://api.jquery.com/jQuery.Callbacks/ //