Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

document widget

  • Loading branch information...
commit c6fbd406ee64e5067f423e7dc7ea443684b91083 1 parent 88979e7
Dominic Tarr authored January 12, 2013

Showing 1 changed file with 19 additions and 0 deletions. Show diff stats Hide diff stats

  1. 19  README.md
19  README.md
Source Rendered
@@ -32,6 +32,25 @@ process.nextTick(function () {
32 32
 
33 33
 ```
34 34
 
  35
+## Widget
  36
+
  37
+There is a simple widget provided for rendering the `r-array` to real time html.
  38
+`widget` takes an `RArray` instance, and a template function
  39
+(a function that accepts a value and returns a `HTMLElement`)
  40
+``` js
  41
+var widget = require('r-array/widget')
  42
+var a = new RArray()
  43
+
  44
+document.body.appendChild(
  45
+  widget(a, function (value) {
  46
+    var pre = document.createElement('pre')
  47
+    pre.innerText = JSON.stringify(value)
  48
+    return pre
  49
+  })
  50
+)
  51
+```
  52
+
  53
+
35 54
 ## License
36 55
 
37 56
 MIT

0 notes on commit c6fbd40

Please sign in to comment.
Something went wrong with that request. Please try again.