The If Works This dirt was a building before

JS.Class

The potentially asynchronous loop

If you write a lot of asynchronous or event-driven code, you’re probably going to end up needing an asynchronous for loop. That is, a loop that runs each iteration sequentially but those iterations may contain non-blocking logic that must halt the loop until the async action resumes. In my case, I need the main loop [...]

What I mean when I use the MIT license

The MIT license, in case you’re not familiar with it, is one of a family of software licenses recognised by the Open Source Initiative. It’s one of the shortest and most liberal, and reads as follows: The MIT License Copyright (c) 2010 James T. Suckerpunch Permission is hereby granted, free of charge, to any person [...]

Evented programming patterns: Object lifecycle

This post is part of a series on event-driven programming. The complete series is: Events: they’re not just for the DOM, you know Observable objects Deferrable values Asynchronous methods First-leg round-up and final remarks Object lifecycle Asynchronous pipelines Testing event-driven apps Earlier in this series I covered a very common pattern in event-driven programming: the [...]

JS.Class 2.1.5 supports Node, Narwhal and more

While there’s much work going on towards what will probably be JS.Class 3.0, the 2.1.x series is benefiting from some of the goodness being added upstream. I’ve just pushed out a new release that gets the package manager and all the libraries to work under CommonJS, specifically targeting Node.js and Narwhal for now. I’ve had [...]

JS.Class and Helium updates

Just a quickie to let you know I’ve pushed out new minor releases of JS.Class and Helium tonight. The updates in JS.Class 2.1.4 center around a totally rewritten package manager that uses an event cycle to trigger dependency downloads instead of polling packages to find out when they’re ready to load; this should make a [...]

Evented programming patterns: Asynchronous methods

This post is part of a series on event-driven programming. The complete series is: Events: they’re not just for the DOM, you know Observable objects Deferrable values Asynchronous methods First-leg round-up and final remarks Object lifecycle Asynchronous pipelines Testing event-driven apps Building on the pattern for deferred processing that we just saw, asynchronous methods are [...]

Evented programming patterns: Deferrable values

This post is part of a series on event-driven programming. The complete series is: Events: they’re not just for the DOM, you know Observable objects Deferrable values Asynchronous methods First-leg round-up and final remarks Object lifecycle Asynchronous pipelines Testing event-driven apps The Deferrable pattern is a specialisation of observable objects that mixes state into the [...]

Evented programming patterns: Observable objects

This post is part of a series on event-driven programming. The complete series is: Events: they’re not just for the DOM, you know Observable objects Deferrable values Asynchronous methods First-leg round-up and final remarks Object lifecycle Asynchronous pipelines Testing event-driven apps As I mentioned in the previous article, events are not things that only live [...]

Events: they’re not just for the DOM, you know

This post is part of a series on event-driven programming. The complete series is: Events: they’re not just for the DOM, you know Observable objects Deferrable values Asynchronous methods First-leg round-up and final remarks Object lifecycle Asynchronous pipelines Testing event-driven apps Over recent months we’ve seen the major JavaScript libraries talking up their event support. [...]

Load everything asynchronously

A couple weeks ago there was rather a lot of excitement over the fact that Google released a new Analytics snippet that loads the tracking library asynchronously. This is indeed great news, for reasons pored over in the aforelinked articles. But let’s take a closer look at Google’s implementation: var _gaq = _gaq || []; [...]

← Before