This package has been deprecated
ultraDOM is now Superfine!! - Whoo-hoo! Please upgrade: 'npm i superfine'.
ultraDOM is a minimal view layer for building declarative web user interfaces.
What's in the bundle? A virtual DOM diff engine, keyed-based node reconciliation, element-level lifecycle events and browser support all the way back to IE9. Mix it with your favorite state management library or use it standalone for maximum flexibility.
npm i ultradom
const view =const app =
ultraDOM consists of a two-function API:
ultraDOM.h creates virtual nodes and
ultraDOM.render renders them into a DOM container.
We try to do this in the least number of steps possible, by comparing the new virtual DOM against the previous one. This leads to high efficiency, since typically only a small percentage of nodes need to change, and changing real DOM nodes is costly compared to recalculating the virtual DOM.
Keys help identify nodes every time we update the DOM. By setting the
key property on a virtual node, you declare that the node should correspond to a particular DOM element. This allow us to re-order the element into its new position, if the position changed, rather than risk destroying it. Keys must be unique among sibling-nodes.
import h from "ultradom"const ImageGallery =images
You can be notified when elements managed by the virtual DOM are created, updated or removed via lifecycle events. Use them for animation, wrapping third party libraries, cleaning up resources, etc.
This event is fired after the element is created and attached to the DOM. Use it to manipulate the DOM node directly, make a network request, create a slide/fade in animation, etc.
import h from "ultradom"const Textbox =
This event is fired every time we try to update the element attributes. Use the
old attributes inside the event handler to check if any attributes changed or not.
import h from "ultradom"import RichEditor from "richeditor"const Editor =
This event is fired before the element is removed from the DOM. Use it to create slide/fade out animations. Call
done inside the function to remove the element. This event is not called in its child elements.
import h from "ultradom"import fadeout from "dom-fade-fx"const MessageWithFadeout =
This event is fired after the element has been removed from the DOM, either directly or as a result of a parent being removed. Use it for invalidating timers, canceling a network request, removing global events listeners, etc.
import h from "ultradom"const Camera =
ultraDOM is MIT licensed. See LICENSE.