3.0.0 • Published 6 years ago

mostly-html v3.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Mostly HTML

Creates HTML from mostly-dom VNode

Get it

yarn add mostly-html mostly-dom
# or
npm install --save mostly-html mostly-dom

API

toHtml(vNode: VNode): string

Given a VNode it returns a HTML string

import { div, button, h1 } from 'mostly-dom'
import { toHtml } from 'mostly-html'

const view = (amount: number) =>
  div({ className: 'foo' }, [
    button({ id: 'increment' }, 'Increment'),
    button({ id: 'decrement' }, 'Decrement'),
    h1(String(amount))
  ])

const html = toHtml(view(1))

console.log(html)
// => <div class="foo"><button id="increment">Increment</button><button id="decrement">Decrement</button><h1>1</h1></div>
3.0.0

6 years ago

2.0.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago