Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with Knockout 3.0.0? #6

Open
adam-marshall opened this issue Dec 4, 2013 · 0 comments
Open

Incompatibility with Knockout 3.0.0? #6

adam-marshall opened this issue Dec 4, 2013 · 0 comments

Comments

@adam-marshall
Copy link

I haven't managed to produce a simple reproduction, but I have had an issue when merely including the localStorage plugin in the scripts section, underneath Knockout 3.0.0.

The issue manifests itself by outputting the observable function code, e.g.

function observable() { if (arguments.length > 0) { // Write // Ignore writes if the value hasn't changed if (!observable['equalityComparer'] || !observable['equalityComparer'](_latestValue, arguments[0])) { observable.valueWillMutate(); _latestValue = arguments[0]; if (DEBUG) observable._latestValue = _latestValue; observable.valueHasMutated(); } return this; // Permits chained assignments } else { // Read ko.dependencyDetection.registerDependency(observable); // The caller only needs to be notified of changes if they did a "read" operation return _latestValue; } }

instead of the observable value.

This occurs even with a simple text binding, e.g.

<span data-bind="text: myObservable"></span>

If I remove the knockout.localStorage.js file, then the bindings work as expected.

Any ideas why this might be happening?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant