knockout.localStorage
knockout.localStorage copied to clipboard
Fails when no first augment is passed into the ko.observable when ko normal assigns a default value
I haven't done a Pull request, but you can fix the problem by beginning the constructor like this (only tested in the latest FireFox version):
ko[method] = function(initialValue, options) {
// see if the initialValue is in fact the options argument, swap their values
if (options == undefined && initialValue != undefined && initialValue.hasOwnProperty('persist')) {
options = initialValue;
initialValue = null;
}
options = options || {};
...