Converts hyperx to snabbdom virtual DOM
npm install hyperx-snabbdomThis module is a fork of hyperx-to-snabbdom extended with a fix for whitespace inconsistency.
The module itself converts hyperx virtual dom build to a snabbdom-compatible output.
npm i --save hyperx hyperx-snabbdom snabbdom
``javascript
// patch.js
var snabbdom = require('snabbdom')
module.exports = snabbdom.init([ // Init patch function with chosen modules
require('snabbdom/modules/class').default, // makes it easy to toggle classes
require('snabbdom/modules/props').default, // for setting properties on DOM elements
require('snabbdom/modules/style').default, // handles styling on elements with support for animations
require('snabbdom/modules/eventlisteners').default // attaches event listeners
])
// html.js
module.exports = require('hyperx')(
require('hyperx-to-snabbdom')(require('snabbdom/h').default)
)
// my-module.js
var patch = require('./patch')
var html = require('./html')
function homeView () {
return html
}patch(document.body, homeView())
``