JSPM

unimorph

0.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q28626F
  • License MIT

Universal DOM morphing

Package Exports

  • unimorph

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (unimorph) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

unimorph Build Status unstable

Universal DOM morpher with nanomorph / morphdom compatible API.

NPM

Supported libs

  • react
  • preact
  • lit-html
import { html } from 'lit-html'
import morph from 'unimorph/lit-html'

var el = document.createElement('div')
el.innerHTML = 'hello people'

el = morph(el, html`<div>nanananana-na-no</div>`)
// <div>nanananana-na-no</div>

el = morph(el, html`<div>teeny, tiny, tin bottle</div>`)
// <div>teeny, tiny, tin bottle</div>

unimorph can morph both to JSX or raw HTML. It works with react by default, preact can be used via preact/compat or directly as:

import morph from 'unimorph/preact'

let result = morph(fromElement, toElementOrJSX)

See also

  • enhook - enable react/preact/etc hooks for any function.
  • unihooks - unreacted hooks.
  • spect - reactive aspect-oriented UI framework.

HK