Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
KnockoutJS Web Development

You're reading from  KnockoutJS Web Development

Product type Book
Published in Feb 2015
Publisher
ISBN-13 9781782161028
Pages 178 pages
Edition 1st Edition
Languages

Using a computed observable


A computed observable provides the following functions:

  • dispose(): This manually disposes the computed observable, clearing all subscriptions to dependencies. This function is useful if you want to stop a computed observable from being updated or want to clean up memory for a computed observable that has dependencies on observables that won't be cleaned.

  • extend(extenders): This applies the given extenders to the computed observable.

  • getDependenciesCount(): This returns the current number of dependencies of the computed observable.

  • getSubscriptionsCount(): This returns the current number of subscriptions (either from other computed observables or manual subscriptions) of the computed observable.

  • isActive(): This returns whether the computed observable may be updated in the future. A computed observable is inactive if it has no dependencies.

  • peek(): This returns the current value of the computed observable without creating a dependency.

  • subscribe( callback [,callbackTarget...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}