Giter Site home page Giter Site logo

knockout-deferred-updates's People

Contributors

kennknowles avatar mbest avatar petermajer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

knockout-deferred-updates's Issues

newCallback used out of scope

In the replacement subscribe function (subFnObj[subFnName] = function(...)), the variable newCallback is used out of scope.

Browser CPU goes to 100% after including this js on my page

I have a number of console messages, and it looks like it does a bit of initialization, then pauses (maybe for garbage collection?) then does more initialization. I can't tell, but it looks like it is looping on the same initialization over and over.

I'm using KO 3.0, I saw this on chrome, and it is during page load, where I'm loading all my stored data into the ko observables.

I'm not sure what other info is useful to you, but I'll expand this description however you like.

Thanks!

Doesn't support KO 3.1.0beta

Just tried out the new KO beta and knockout-deferred-updates throws "Uncaught Error: Only subscribable things can act as dependencies". It's a beta so full compatibility is obviously not expected, just thought it might be good to add that here :)

Deferring plain-old observable updates

Can deferred updates handle the following scenario? If not, I'm considering forking.

myObservable(newValue);

Imagine a paged list of items with a search filter. When you switch pages you switch pages, your updating the pageNumber observable. When the filter updates, you're updating the filter observable, but also calling:

pageNumber(1);

Then there's a third computed observable (called query) that returns the wrapped values of both the filter and current page to a client that will make an ajax call. The client has subscribed to query, but when you update the filter, query updates twice (once because filter has changed and once because pageNumber has been changed by the filter subscribe).

Here's a jsfiddle for the scenario: http://jsfiddle.net/edUxS/9/

Thanks.

Getting TypeError: currentFrame.callback is not a function

Hello

I'm getting the error below when using the library on my page.

Line 347:
currentFrame.callback(subscribable, subscribable._id || (subscribable._id = getId()));

I am using knockout 3.3 (get the error in 3.2 as well) with the ko.mapping and ko.postbox libraries.

Apart from loading the script all i am doing is including the line:

ko.computed.deferUpdates = false;

immediately after the script and then defering updates on an observable arrary further down the line , loading some data and then taking off defered updares again.

self.items.data.deferUpdates = false;

...load some data into self.items.data

self.items.data.deferUpdates = true;

the defered updates to self.items.data seem to be working but the error is preventing other ko page elements working.

thanks

Ross

semver tags (for bower compatibility)

This package does have nice versions. I hate to suggest Yet Another Package System To Keep Happy (YAPSTKH) but it would be lovely to be able to bower install, or similar. I believe all it takes is a git tag with the semver, which seems nice anyhow.

knockout 3.2

Hi possibly rude to post a question as an issue - bu8t does this support knockout 3.2.0 esp purecomputeds?

many thanks

Examples

I wish you'll add an example for each function in your interfaces,
I am not completely understand them from your doc...

I am currently using ko.processAllDeferredBindingUpdates() for waiting for UI to release.
I sure that there is much more to that :)

Knockout computed update notification sometimes not firing

I am currently investigating a very weird bug in my application which seems to be strongly-related to the ko-deferred-updates v.3.2.0.

When using the newest version, sometimes (in a very hard to reproduce way) either the update notification of a changed computed is not sent or subscribing computed's just ignore said notification. Either way I detect bindings that stay frozen in states, dependent computed's that get corrupted computations because they use old values, etc.

It may be the same for normal observables but since I use more computed's than observables, I did not find such a case with observables in my application yet.

Unfortunately I was unable to find a reproducible way.
Used Knockout version is the newest, 3.2.0.
This does not happen when using ko-deferred-updates v.3.1.0 (albeit with a small hack to deactivate the version check to use it for ko 3.2.0, which worked perfectly for months) and thus only started to occur since the last update.

IE8 Compatibility - try...finally blocks

In Internet Explorer less than or equal to version 8, I receive an error that "Object doesn't support this property or method". The debugger points to the try{}finally{} blocks.

Adding a inert catch statement should make the solution more cross-ie friendly:
catch (e) { }

For reference, a similar bug arose in jQuery: http://bugs.jquery.com/ticket/9033

I believe the eventual solution for the jQuery team was to avoid the try...finally altogether, but for this plugin, adding the catch seems to work though I haven't fully tested.

Knockout 3.3?

Looks like latest version in not compatible with KO 3.3. Is there a technical reason?

knockout-deferred-updates does not play nicely with Throttle in Safari IOS 7

Hello, just ran into a weird issue, I'm using knockout-3.0.0 with knockout-deferred-updates included, I have the following example page:

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Test</title>
</head>
    <body>
        <div>
            <input type="text" data-bind="value: MyStringObservable, valueUpdate: 'afterkeydown'" />
        </div>
        <div>
            <span data-bind="text: MyStringComputed"></span>
        </div>
        <script type="text/javascript" src="knockout-3.0.0.js"></script>
        <script type="text/javascript" src="knockout-deferred-updates.min.js"></script>
        <script type="text/javascript">
            function AppViewModel() {

                var self = this;

                self.MyStringObservable = ko.observable("");
                self.MyStringComputed = ko.computed(function () {
                    return self.MyStringObservable();
                }).extend({ throttle: 500, deferred: false });

            }

            ko.applyBindings(new AppViewModel());
        </script>
    </body>
</html>

I am using throttle to ensure the computed observable that is dependent on the bound textbox only recomputes after 500ms, however, on Safari IOS 7, this causes the textbox to enter a bugged state where characters are glitching/being removed as you type.

This only occurs when I include throttle and deferred in the same project.

As per my code snippet, even if include deferred: false on the computed observable, the bug still occurs.

Cheers

Use `after` on update for bindings which are deferred together.

I don't know if it's necessary, nor if it's useful. I just wanted to point out that you could potentially add this functionality to deferred updates, and that I think it would intuitively work in this manner.

Here's a jsfiddle to illustrate that the second will fire before the first, even though it's marked as after the first.

I created this fiddle just to see if it worked in that manner. If you open the debugger, a debugger point will be hit. If you then Shift + F11 up the stack, before you reach the top, you'll hit another. So both of them are run in the same stack.

Again, likely not an issue for anybody. Just wanted to share this insight into the inner workings of knockout.

dependentObservable.notifySubscribers = undefined

I'm having an issue on line 535 where the dependentObservable says it has no method notifySubscribers. I'm using Knockout 2.3.0 with Durandal.JS and Breeze.JS

my computed looks like this. I'm using lodash map function to create a new object for each object in the array of rigs

        self.rigSelect = ko.dependentObservable(function () {
            var rigs = _(self.rigs()).map(function (rig) {
                return {
                    rig: rig,
                    name: '('+(rig.number())+ ') ' + (rig.name())
                };
            });
            return rigs.value();

        });

Uncaught binding error prevents other bindings from running

Is there any reason why execution of the tasks isn't wrapped in a try-catch to prevent a task error from borking the rest?

I'm referring to lines: here and here.

I've been finding that a single binding error kills the task chain and prevents other bindings from executing. Causes no end of weird issues.

re-evaluation only for change events (but still queue for dirty)

If/when knockout/knockout#458 becomes part of Knockout, this plugin will need to be modified to the cases where a computed observable is re-evaluated, but its value doesn't change (and thus it doesn't trigger a change event).

My idea is that the Deferred Updates plugin will watch for both dirty and change events for computed dependencies. The dirty event will add the computed to the queue, but only a change event will actually trigger re-evaluation (by setting _needsEvaluation = true).

Knockout 3.4

I know that 3.4 is not yet stable (though it seems like its release is only days away) but it looks like ko-deferred-updates has to be updated to support ko 3.4. I noticed errors when trying to use 3.4's rate limiting functionality.

I guess at some point in time, this plugin will be abandoned due to the efforts to integrate deferral into ko's core, but I hope that we're not there yet as this plugin seems to handle at least some use cases (like mine: knockout/knockout#1905 (comment) ) better as of now ;)

Breaks deferEvaluation computed bindings on IE10 with KO 3.1+

Starting with Knockout v3.1, the deferred-updates plugin breaks bindings to deferEvaluation computeds on IE10. The bindings are receiving the computed function itself, instead of the value. I have no idea why.

JSFiddle demo (open in IE10): https://jsfiddle.net/cstigler/Lge05opy/1/

That demo uses the latest releases of both Knockout (3.3) and deferred-updates (the current version on master on GitHub). It's broken for me in the official IE10/Win7 virtual machine provided at modern.ie. Weirdly, while it's 100% broken in Knockout 3.3, if I compile Knockout 3.2 using closure-compiler 0.2.0, this bug will not occur. But if I compile KO 3.2 using closure-compiler 0.2.1, it's broken (the official production build is broken).

So my best guess is that the newer versions of closure-compiler are removing something from the KO internals that deferred-updates needs, in this specific case.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.