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 7638451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:10:51+00:00 2026-05-31T08:10:51+00:00

I created a simple demo here that demonstrates the problem: http://jsfiddle.net/boblauer/eCugY/ Basically, I want

  • 0

I created a simple demo here that demonstrates the problem:

http://jsfiddle.net/boblauer/eCugY/

Basically, I want my userUpdated function to run when I update the user property, but it only runs once when the page loads.

Any help is appreciated.

  • 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-31T08:10:52+00:00Added an answer on May 31, 2026 at 8:10 am

    Your problem is that you expect the userUpdated computed to fire when the user is updated because you set the user as the computed’s context.

    How these the KO computed work is, it first fires immediately and in the course of firing any observables that are encountered are recorded. When one of those observables is updated the computed function fires again. In your case your function calls no observables. It simply calls alert. The context object is not counted among the observables list.

    You could get this to work by just using the user observable in your function. Alternativly you probably should be using a subscribe which is a function that get’s called when an observable changes. Replace your computed with

    user.name.subscribe(function(newvalue) {
        alert('user updated to ' + newvalue);
    });
    

    Computed’s are usually used to return computed values. If you start to use them as arbitrary function callers you can end up getting into infinite loops (if you decide to update an observable within the computed).

    Hope this helps.

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

Sidebar

Related Questions

I'd like to create a simple browser client that I'll to demo the REST
I created a simple .NET windows application in Visual Studio 2005 and on just
I have created this simple JavaScript code that allows a user to click on
I am creating a simple Prism 2.1 demo that uses the 'directory search' approach
This simple sample code demonstrates the problem. I create an ArrayBlockingQueue , and a
I followed ChrisF here and write a simple demo . ...open your project in
I'm working on a demo that makes use of Spring.NET IoC capability in ASP.NET
I have created a LESS ( http://lesscss.org/ ) version of a simple css grid
I am about to create a simple demo in flash where I have 3
Could someone help me on this, I have created simple web services using axis2

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.