Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

computed-observable

How to create a computed observable array in Knockout

June 8, 2023 by Tarik

This will combine the two arrays and return the combined list. However, it is not a computed observable array (don’t know if that is even possible), but a regular computed observable. self.masterList = ko.computed(function() { return this.listA().concat(this.listB()); }, this);

Categories knockout.js Tags computed-observable, knockout.js, ko.observablearray Leave a comment

Knockout: computed observable vs function

April 17, 2023 by Tarik

If the only purpose of your computed observable is to do a simple binding against it, then using a function would be equivalent. Bindings are implemented inside of a computed observable to track the dependencies, so it will re-trigger your binding when any of the observables change. Here are a few things to consider about … Read more

Categories knockout.js Tags computed-observable, knockout-2.0, knockout.js Leave a comment

Force a computed property function to run

February 2, 2023 by Tarik

I realized my first answer missed your point, and won’t solve your issue. The problem is that a computed will only reevaluate if there is some observable that forces it to re-evaluate. There is no native way to force a computed to re-evaluate. However, you can get around this with some hackery by creating a … Read more

Categories knockout.js Tags computed-observable, knockout.js Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa