An open API service indexing awesome lists of open source software.

https://github.com/azer/virtual-glue

Render HTML with Hyperglue and VirtualDOM
https://github.com/azer/virtual-glue

Last synced: 11 months ago
JSON representation

Render HTML with Hyperglue and VirtualDOM

Awesome Lists containing this project

README

          

## virtual-glue

Render HTML with [Hyperglue](http://github.com/substack/hyperglue) and [VirtualDOM](http://npmjs.org/virtual-dom)

## Install

```bash
$ npm install virtual-glue
```

## Usage Example

A simple clock app:

```js
var glue = require('virtual-glue')
var time = require('format-date')

var patch = glue(document.body, '

', function () {
return {
'.now': time('{hours}:{minutes}:{seconds}')
}
})

setInterval(patch, 1000)
```

On server-side (a.k.a one-time render)

```js
var glue = require('virtual-glue')
var time = require('format-date')

var html = glue('

', {
'.now': time('{hours}:{minutes}:{seconds}')
})

html
// =>

15:03:17


```