Update the configure section in the README.
Showing
1 changed file
with
11 additions
and
3 deletions
... | @@ -34,11 +34,11 @@ Then tell Rivets.js what model(s) to bind to it: | ... | @@ -34,11 +34,11 @@ 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 (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. | 37 | Use `rivets.configure` to configure Rivets.js for your app (or you can set configuration options manually on `rivets.config`). |
38 | 38 | ||
39 | #### Adapter | 39 | #### Adapter |
40 | 40 | ||
41 | Rivets.js is model interface-agnostic, meaning it can work with any event-driven model by way of defining an adapter. An adapter is just an object that responds to `subscribe`, `unsubscribe`, `read` and `publish`. Here is a sample configuration with an adapter for using Rivets.js with Backbone.js. | 41 | Rivets.js is model interface-agnostic, meaning it can work with any event-driven model by way of defining an adapter. This is the only required configuration as it's what Rivet.js uses to observe and interact with your model objects. An adapter is just an object that responds to `subscribe`, `unsubscribe`, `read` and `publish`. Here is a sample configuration with an adapter for using Rivets.js with Backbone.js. |
42 | 42 | ||
43 | rivets.configure({ | 43 | rivets.configure({ |
44 | adapter: { | 44 | adapter: { |
... | @@ -63,7 +63,15 @@ Rivets.js is model interface-agnostic, meaning it can work with any event-driven | ... | @@ -63,7 +63,15 @@ Rivets.js is model interface-agnostic, meaning it can work with any event-driven |
63 | 63 | ||
64 | To prevent data attribute collision, you can set the `prefix` option to something like 'rv' or 'bind' so that data attributes are prefixed like `data-rv-text`. | 64 | To prevent data attribute collision, you can set the `prefix` option to something like 'rv' or 'bind' so that data attributes are prefixed like `data-rv-text`. |
65 | 65 | ||
66 | Set the `preloadData` option to `true` or `false` depending on if you want the binding routines to run immediately after the initial binding or not — if set to false, the binding routines will only run when the attribute value is updated. | 66 | rivets.configure({ |
67 | prefix: 'rv' | ||
68 | }); | ||
69 | |||
70 | Set the `preloadData` option to `false` if you don't want your bindings to be bootstrapped with the current model values on bind. This option is set to `true` by default. | ||
71 | |||
72 | rivets.configure({ | ||
73 | preloadData: false | ||
74 | }); | ||
67 | 75 | ||
68 | ## Extend | 76 | ## Extend |
69 | 77 | ... | ... |
-
Please register or sign in to post a comment