Socket
Book a DemoInstallSign in
Socket

@veams/base

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@veams/base

Base Class for Components and Services

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
2
Created
Source

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": {}
}

Keywords

Veams

FAQs

Package last updated on 23 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts