ractivejs/ractive — pull request #902 by martypdx (2014-07-01 18:08:33+00:00)
Title: Component fn

Like partials, components can now be specified via function:

```js
components: {
widget: function( data ) {
return data.foo ? Widget1 : Widget2;
}
}
```

You can also use the string tag moniker and the component will be looked up. Useful in passing in from view parent:
```js
DynamicColumn = Ractive.extend({
components: {
column: function( data ) {
return data.type + 'Column'
}
}
}
```

For the astute and curious who recognize `Ractive.extend` also returns a function, the result of `Ractive.extend` is tagged with a `._parent` property that we use elsewhere to navigate the inheritance chain (`getPrototypeOf` no workie older IE). So, if the function passed to a component registry key does _not_ have that prop, then it gets executed as option function.