Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7248857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:11:51+00:00 2026-05-28T22:11:51+00:00

When my user logs in, I load a bunch of data from the server.

  • 0

When my user logs in, I load a bunch of data from the server. This take a lot of time because it seems that the dependent observables are updated on every addition to an observableArray(). I would like to defer the evaluation of all dependencies until all data are loaded. I have seen how deferEvaluation: true can be used to affect the behavior of a specific ko.computed() variable, but I would like to isolate the observable until I know it’s done being updated, and then invalidate the entire model to redraw the view.

I’ve created a jsfiddle to illustrate the problem. Note that in my real code, I am using the mapping plugin to load objects, but here I just simulate all the dependencies with a .subscribe function that gets called on every state change. I would like to prevent it from being called until the very end.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T22:11:51+00:00Added an answer on May 28, 2026 at 10:11 pm

    Typically, in a situation like this you would access the underlying array from an observableArray and push to it. Then, you would either push the last one to the observableArray or call myObservableArray.valueHasMutated().

    So, in general it would look like:

    var underlyingArray = this.items();
    underlyingArray.push(one);
    underlyingArray.push(two);
    underlyingArray.push(three);
    this.items.valueHasMutated();
    

    In your fiddle, you could do this.document().history().push(this);. Then, you would have to go back through and call valueHasMutated() on the the affected documents, if you wanted your subscription to run.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to start a program every time the user logs in, but I
The issue here is that when my user logs into my app, they always
I've added the following code to my masterpage (Page_Load) so once a user logs
When a user logs in to my site I want a css styled button
When a user logs in, I give them a cookie named auth with a
I have a pop-up window a user logs into, once they are logged in
Hai I have developed a standalone application in which when an user logs in,
Imagine an ASP.NET website which displays stock prices when a user logs in. Can
I'd like to track how many times a user logs in to my site
In my web app, when a user logs in, I add his Id to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.