Closed grofit closed 9 years ago
I'll have to look into this for a bit as I'm not too familiar with Knockout. I'll get back to you as soon as I can.
No rush, in this case it just provides observable objects so you can subscribe to them, like
var observableValue = ko.observable(20);
observableValue.subscribe(function(newValue) { stuffChanged(); });
observableValue(30); // this triggers stuffChanged
I'd love to get this to work, but I feel like it'd require quite a bit of code for a (probably) rather uncommon use case. I get why you'd want the functionality, but in the end, leaving the events delegated to Knockout and then doing the update separately using Countable should work best. I'll close this for now.
Thats cool, thanks for looking.
I was using once before every time an update happened which was fine, but I thought it would probably be easier to use live, but it doesnt update.
The element its targeting is driven by a knockout observable like so:
<div id="preview" data-bind="text: someTextObservable"></div>
So that div will change its content every time
someTextObservable
changes, now I notice in the source code that it is looking for key pressed based events, whereas in this case those would not apply as its a div not an input.I know there are some events for mutations part of the newer html spec so not sure if you are fussed about supporting them or not, I can go back to just using once whenever it updates which is fine, but just wanted to raise this incase you wanted to extend support.