@f/replace-element

Replace a DOM element with another DOM element

Stats

StarsIssuesVersionUpdatedCreatedSize
@f/replace-element
001.0.06 years ago6 years agoMinified + gzip package size for @f/replace-element in KB

Readme

replace-element

Build status Git tag NPM version Code style

Replace a DOM element with another DOM element

Installation

$ npm install @f/replace-element

Usage

var replaceElement = require('@f/replace-element')

function replaceVnode (newVnode, oldVnode) {
  return replaceElement(newVnode.element, oldVnode.element)
}

API

replaceElement(newNode, oldNode)

  • newNode - The new node that you want to replace oldNode with
  • oldNode - The node you want to replace

Returns: The replaced node (oldNode).

License

MIT

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.