0.5.3 • Published 7 years ago

r-array v0.5.3

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

r-array

Replicated Array

<img src=https://secure.travis-ci.org/dominictarr/r-array.png?branch=master>

(via scuttlebutt)

example

var RArray = require('r-array')

var a = new RArray()
var b = new RArray()
var s;

//pipe instances together...
(s =a.createStream())
  .pipe(b.createStream())
  .pipe(s)

//see https://github.com/dominictarr/scuttlebutt

a.splice(0, 0, 'A', 'B', 'C', 'D')

process.nextTick(function () {
  console.log(b.toJSON())
})

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)

If you do not provide a template, RArray will render the JSON value of each item.

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.5.3

7 years ago

0.5.2

10 years ago

0.5.1

11 years ago

0.5.0

11 years ago

0.4.1

11 years ago

0.4.0

11 years ago

0.3.1

11 years ago

0.3.0

11 years ago

0.2.1

11 years ago

0.1.0

11 years ago

0.0.0

11 years ago