@veams/base
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Base (@veams/base)

Base Class for Components and Services which will be used in Veams projects.


Features

  • Deep merge support for option objects
  • Unique id generation
  • mixin support
  • TypeScript support

Installation

NPM

npm install @veams/base --save

Yarn

yarn add @veams/base

Usage

class Test extends Base {
	constructor(obj) {
		let options = {
			selectors: {
				'container': '.test',
				'btn': '.btn-danger'
			},
			classes: {
				active: 'is-active'
			}
		};

		super(obj, options);
	}
}

const test = new Test({
	// el: $(''),
	namespace: 'test',
	options: {
		selectors: {
			'container': '.container'
		}
	}
});

Output

{
	"_namespace": "test",
	"_instanceId": "test_1518477164034_266f9fa5-6faf-064b-7d2e-e23cfaf2855e",
	"options": {
		"selectors": {
			"test": ".container",
			"btn": ".btn-danger"
		},
		"classes": {
			"active": "is-active"
		}
	},
	"_el": {}
}

Readme

Keywords

Package Sidebar

Install

npm i @veams/base

Weekly Downloads

44

Version

1.0.3

License

MIT

Unpacked Size

9.9 kB

Total Files

9

Last publish

Collaborators

  • andy-gutsche
  • sebastian-fitzner