Knockout.js: dependent vs computed observables

I’ve been going over alot of knockout work lately and I’m new to 2.0. I’d seen material on dependent observables and then some stuff on computed observables and thought they were different things! I’d been meaning to google what their differences were when I ran across this on Knockoutjs:

What happened to dependent observables?

Prior to Knockout 2.0, computed observables were known as dependent observables. With version 2.0, we decided to rename ko.dependentObservable to ko.computed because it is easier to explain, say, and type. But don’t worry: this won’t break any existing code. At runtime, ko.dependentObservable refers to the same function instance as ko.computed — the two are equivalent.

That makes a lot of sense now! Yay one less thing to have to know. You should check out the API, its pretty useful. I’m going to try and write a small blurb about using a computed observable in a separate viewModel to read/write data from cookies.

2 Responses to Knockout.js: dependent vs computed observables

How to Use Knockouts Computed Observables with the Mapping Plugin

This is a blurb on using knockout‘s computed observables on a collection of items that are made observable via the mapping plugin. If you haven’t seen KnockoutJS then immediately go and watch all the demo / intro videos you can. You’ll be extremely impressed!

[Continue Reading...]

8 Responses to How to Use Knockouts Computed Observables with the Mapping Plugin

3D Tiles in 2D Part 2 – Tile Grid

Welcome to Part 2 of the 3D Tiles in 2D series. In part one of this series, we talked about the mechanics of drawing tiles that look 3D in 2D. From there, we are going to talk about how to write a class that represents a tile grid and handles all of the stuff we talked about in the last section for us and exposes all the methods we need to not care about how the tile system works outside of the class. [Continue Reading...]

One Response to 3D Tiles in 2D Part 2 – Tile Grid

Handling Server Side Exceptions During Ajax Requests

When developing typical server side functionality in ASP.NET we don’t usually worry about the users experience with errors or authentication issues. We don’t worry about that much because we know our custom error pages and forms auth will redirect our clients to the appropriate content. Its not great that our client gets redirected to an error page, but its better than the YSOD, etc.

When we’re working with ajax requests, we don’t have any of this built in functionality. Everything is up to us and the callbacks that we setup. All of our clients will eventually encounter unhandled exceptions during their ajax requests and without the proper handling, the users experience could be awful. Nowadays, the more we can control the users experience, especially in the event of a failure, the better. This article is all about building a way to easily handle the common types of failures and ensuring predictable results for our clients. This stuff isn’t that hard, and we should be able to do it in a way that “just works” for all ajax requests that we make.

[Continue Reading...]

2 Responses to Handling Server Side Exceptions During Ajax Requests