Permalink
Browse files

document widget

  • Loading branch information...
1 parent 88979e7 commit c6fbd406ee64e5067f423e7dc7ea443684b91083 @dominictarr committed Jan 12, 2013
Showing with 19 additions and 0 deletions.
  1. +19 −0 README.md
View
@@ -32,6 +32,25 @@ process.nextTick(function () {
```
+## Widget
+
+There is a simple widget provided for rendering the `r-array` to real time html.
+`widget` takes an `RArray` instance, and a template function
+(a function that accepts a value and returns a `HTMLElement`)
+``` js
+var widget = require('r-array/widget')
+var a = new RArray()
+
+document.body.appendChild(
+ widget(a, function (value) {
+ var pre = document.createElement('pre')
+ pre.innerText = JSON.stringify(value)
+ return pre
+ })
+)
+```
+
+
## License
MIT

0 comments on commit c6fbd40

Please sign in to comment.