carry

0.0.4 • Public • Published

carry

Carry attrs, classes from one element to another.

Installation

Install with component(1):

$ component install yields/carry

Example

 
function Widget(el){
  this.el = carry(el, tpl.cloneNode());
}
 
new Widget;
new Widget(el);
 

API

carry(a, b)

if a is null a clone of b will be returned. otherwise b's attrs and classes are merged with a, returning a.

.attrs(a, b)

Carry over attributes from b to a.

.classes(a, b)

Carry over classes from b to a.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i carry

Weekly Downloads

31

Version

0.0.4

License

MIT

Last publish

Collaborators

  • defunctzombie