Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed Feb 21, 2019
1 parent 854344f commit 015a42a
Show file tree
Hide file tree
Showing 7 changed files with 3,955 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: eslint-config-riot

parserOptions:
ecmaVersion: 2018
sourceType: 'module'

globals:
chai: true
14 changes: 14 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require('./register')
const {__} = require('riot')

module.exports = function render(tagName, component, props) {
const cleanup = require('jsdom-global')()
const root = document.createElement(tagName)
const element = __.defineComponent(component)({props}).mount(root)

const html = element.root.outerHTML

cleanup()

return html
}
Loading

0 comments on commit 015a42a

Please sign in to comment.