addyosmani/essential-js-design-patterns — pull request #60 by silvenon (2012-10-28 02:07:25+00:00)
Title: Fixes: The Observer Pattern

As I'm reading the book, I'll send fixes in batches. This is the first one :) First commit represents changes you certainly want, other ones represent changes you probably want.

I'll explain some stuff that might not be obvious, in order of appearance :P

### The Observer Pattern

`gridUpdate` is called before it's defined. Also, I noticed that sometimes you define named functions and sometimes you assign anonymous functions to variables. As far as I know JavaScript, they are pretty much the same, so I suggest you pick one, because it's kind of confusing. For example, `gridUpdate` is an assigned anonymous function, other grid functions are named.

The function `extend` is naming it's parameters in the wrong order, because the function seemed like it was extending an extension. Also, the parameter order is unlike other `extend` functions out there, they all start with the object first, **then** the extension, so you might wanna change that.

I renamed `ratingTemplate` to `ratingsTemplate` because the ID is named that way.