I\'ve got a model class in KnockoutJS which has multiple values that I\'d like to subscribe to. Each subscription will perform the same task, like so:
funct
Do you not want to duplicate handler function's body? Extract it to a variable.
function CaseAssignmentZipCode(zipCode, userId, isNew) {
var self = this;
self.zipCode = ko.observable(zipCode);
self.userId = ko.observable(userId);
self.isNew = isNew;
self.isUpdated = false;
var handler = function () { self.isUpdated = true; };
self.zipCode.subscribe(handler);
self.userId.subscribe(handler);
}