ddeb06ba by Michael Richards

Update README.

1 parent 2e05db93
...@@ -34,7 +34,7 @@ Then tell Rivets.js what model(s) to bind to it: ...@@ -34,7 +34,7 @@ Then tell Rivets.js what model(s) to bind to it:
34 34
35 ## Configure 35 ## Configure
36 36
37 Use `rivets.configure` to configure Rivets.js for your app. There are a few handy configuration options, such as setting the data attribute prefix and adding formatters that you can pipe binding values to, but setting the adapter is the only required configuration since Rivets.js needs to know how to observe your models for changes as they happen. 37 Use `rivets.configure` to configure Rivets.js for your app (or set them manually on `rivets.config`). There are a few handy configuration options, such as setting the data attribute prefix and adding formatters that you can pipe binding values to, but setting the adapter is the only required configuration since Rivets.js needs to know how to observe your models for changes as they happen.
38 38
39 #### Adapter 39 #### Adapter
40 40
...@@ -81,15 +81,15 @@ Set the `preloadData` option to `true` or `false` depending on if you want the b ...@@ -81,15 +81,15 @@ Set the `preloadData` option to `true` or `false` depending on if you want the b
81 81
82 ## Extend 82 ## Extend
83 83
84 Rivets.js comes with only the most commonly used bindings and encourages developers to add their own that are specific to the needs of their application. Rivets.js is extended by adding your own custom binding routines. *Binding routines* are the functions that run when an observed attribute changes. Their sole concern is to describe what happens to the element when a new value comes in. 84 Rivets.js comes bundled with a few commonly used bindings, but users are encouraged to add their own that are specific to the needs of their application. Rivets.js is easily extended by adding your own binding routines. *Binding routines* are the functions that run when an observed attribute changes. Their sole concern is to describe what happens to the element when a new value comes in. All binding routines are publicly available on the `rivets.routines` object.
85 85
86 All binding routines are available on the `rivets.routines` object so it's easy to extend by adding/removing them from that object. Let's say we wanted a `data-color` binding that sets the element's colour, here's what the routine function for that might look like: 86 Let's say we wanted a `data-color` binding that sets the element's colour, here's what the routine function for that binding might look like:
87 87
88 rivets.routines.color = function(el, value) { 88 rivets.routines.color = function(el, value) {
89 el.style.color = value; 89 el.style.color = value;
90 }; 90 };
91 91
92 With that routine defined, the following binding will update the elements color when `model.color` changes: 92 With that routine defined, the following binding will update the element's color when `model.color` changes:
93 93
94 <span data-color="model.color">COLOR</span> 94 <span data-color="model.color">COLOR</span>
95 95
......