Before ranting about Hooks, here's a brief review of React's history...
In React, you can just use a plain function as a component. These are great for simple components that don't have any internal state.
#!/bin/sh | |
# | |
# Creates a SmartOS VM in VirtualBox (assuming you alread have VirtualBox installed) | |
# | |
# This script will: | |
# * Download the latest live ISO image of SmartOS | |
# * Create a VirtualBox VM, or update an existing VM with the latest ISO | |
# * Configure the VM with a zones disk, and boot it! | |
# | |
# |
class Post | |
include DataMapper::Resource | |
property :id, Serial | |
belongs_to :author, :default => lambda { |r, a| Author.first } | |
end | |
class Author | |
include DataMapper::Resource |
// this is (of course) a horrible simplification | |
// but assume that all objects have something like this... | |
function _get_set(prop, value){ | |
if(typeof(value) !== "undefined"){ | |
this['_' + prop] = value; | |
} | |
return this['_' + prop]) | |
} | |
thing = { |
<html> | |
<head> | |
<title>Dojo Test</title> | |
<style type="text/css"> | |
/* use the tundra theme */ | |
@import "http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css"; | |
/* Note that if you don't specify a minor revision, e.g. 1.5.0 or 1.4.3, the CDN will deliver the latest version */ | |
</style> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js.uncompressed.js" djConfig="parseOnLoad:true"></script> | |
<script type="text/javascript"> |