IMHO not the job of Idb to store the callbacks, so I don't see this
complexity as a reason not to implement the API using callbacks. I think
having one consistent API is more important.
Specifying the collation 'name' has all the same problems as callbacks
(needs to be re-done on every page, possibility of using different
collations on different pages).
Really a 'function' is just a symbol for a collation. A function name, is a
better symbol for a collation than a string. Function's have a uniqueness
property strings do not. So specifying a function as the collations instead
of a string really is the same thing. Consider below:
// version 1
var test1 = function(a) {
if (a === 'x') { /*X*/ } else if (a === 'y') { /*Y*/ }
};
test1('x');
test1('y');
// version 2
var x = function() {};
var y = function() {};
var test2 = function(a) {
if (a === x) { /*X*/ } else if (a === y) { /*Y*/ }
}
test2(x);
test2(y);
Cheers,
Keean.
On Mar 22, 2011 10:44 PM, "Pablo Castro" <Pablo.Castro@microsoft.com> wrote: