Is there any straightforward method of ensuring an observable array only allows unique items are added to it. I think ideally I'd define a function that returned the property of the item in the array I want to use as a uniqueness constraint.
var myData = ko.observableArray([]);
myData.unique(function(item) {
});
myData.push(new { id: 1, name: "Bob" });
myData.push(new { id: 1, name: "Sue" });
I'd want myData to ignore the second push. I'm also open to other ways of doing this.