component.js
function (obj, properties) {
			var events, propertyDescriptors, i;
			if (!properties) { return; }

			// Clone events
			if (properties.on) {
				events = Object.assign({}, properties.on);
			}

			Object.assign(obj, properties); // IE11 need a polyfill

			// Handle events
			if (events) {
				for (i in events) {
					this.addCustomEvent(obj, i, events[i]);
				}
				delete obj.on;
			}

			// Handle observed attributes
			if (properties.observedAttributes) {
				if (!obj.observedAttributesList) {
					obj.observedAttributesList = [];
				}
				Array.prototype.push.apply(obj.observedAttributesList,properties.observedAttributes);			
			}

			// Handle properties getters and setters
			if (properties.define) {
				propertyDescriptors = Object.assign({}, properties.define);
				Object.defineProperties(obj, propertyDescriptors);
			}
		}
function (obj, properties) {
			var events, propertyDescriptors, i;
			if (!properties) { return; }

			// Clone events
			if (properties.on) {
				events = Object.assign({}, properties.on);
			}

			Object.assign(obj, properties); // IE11 need a polyfill

			// Handle events
			if (events) {
				for (i in events) {
					this.addCustomEvent(obj, i, events[i]);
				}
				delete obj.on;
			}

			// Handle observed attributes
			if (properties.observedAttributes) {
				if (!obj.observedAttributesList) {
					obj.observedAttributesList = [];
				}
				Array.prototype.push.apply(obj.observedAttributesList,properties.observedAttributes);			
			}

			// Handle properties getters and setters
			if (properties.define) {
				propertyDescriptors = Object.assign({}, properties.define);
				Object.defineProperties(obj, propertyDescriptors);
			}
		}
function ( obj , properties ) { var events , propertyDescriptors , i ; if ( ! properties ) { return ; } // Clone events if ( properties . on ) { events = Object . assign ( { } , properties . on ) ; } Object . assign ( obj , properties ) ; // IE11 need a polyfill // Handle events if ( events ) { for ( i in events ) { this . addCustomEvent ( obj , i , events [ i ] ) ; } delete obj . on ; } // Handle observed attributes if ( properties . observedAttributes ) { if ( ! obj . observedAttributesList ) { obj . observedAttributesList = [ ] ; } Array . prototype . push . apply ( obj . observedAttributesList , properties . observedAttributes ) ; } // Handle properties getters and setters if ( properties . define ) { propertyDescriptors = Object . assign ( { } , properties . define ) ; Object . defineProperties ( obj , propertyDescriptors ) ; } }
Adds a feature to the component
@param {object} obj - Target object. Usually a prototype of a component. Properties "on", "define", "observedAttribute" will be stacked.
Adds a feature to the component