Files: 8c686fb2b73c28246604759c61d6636e2812d871 / test / to-html.js
522 bytesRaw
1 | |
2 | var pull = require('pull-stream') |
3 | var u = require('../util') |
4 | |
5 | var h = u.h |
6 | var toHTML = u.toHTML |
7 | |
8 | var hs = h('h1', function (cb) { |
9 | if(cb == null) throw new Error('cb should not be null') |
10 | console.log('CB?', cb) |
11 | setTimeout(function () { |
12 | cb(null, 'hello world') |
13 | }) |
14 | }, |
15 | h('ol', |
16 | pull.values([ |
17 | h('li', 'one'), |
18 | h('li', 'two'), |
19 | h('li', 'three'), |
20 | ]) |
21 | ) |
22 | ) |
23 | |
24 | console.error(hs) |
25 | |
26 | toHTML(function (cb) { cb(null, hs) })(function (err, el) { |
27 | if(err) throw err |
28 | console.log(el, el.outerHTML) |
29 | }) |
30 | |
31 |
Built with git-ssb-web