# ngx-elvis-base

> #### Install

Latest version **1.0.15** (published 2019-08-08) · 0 weekly downloads

## Install

```sh
npm install ngx-elvis-base
pnpm add ngx-elvis-base
yarn add ngx-elvis-base
bun add ngx-elvis-base
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.15 |
| Published | 2019-08-08 |
| First published | 2019-06-28 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 285.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | macchie7 |

## Links

- npm: https://www.npmjs.com/package/ngx-elvis-base
- npm.io page: https://npm.io/package/ngx-elvis-base

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Recent versions

- 1.0.15 (latest) — 2019-08-08
- 1.0.14 — 2019-08-08
- 1.0.13 — 2019-08-08
- 1.0.12 — 2019-08-08
- 1.0.11 — 2019-08-08
- 1.0.10 — 2019-08-08
- 1.0.9 — 2019-08-08
- 1.0.8 — 2019-08-07
- 1.0.7 — 2019-08-07
- 1.0.6 — 2019-08-07
- 1.0.4 — 2019-08-07
- 1.0.3 — 2019-06-28
- 1.0.2 — 2019-06-28
- 1.0.0 — 2019-06-28
- 0.0.1 — 2019-06-28

## README

## ngx-elvis-base [ElvisBaseModule]

#### Install

```bash
$ npm i -s ngx-elvis-base
```

#### Features

###### --- BaseClass

Provides basic Class features.

###### --- BaseComponent (extends BaseClass)

Provides basic Component features + basic Class features.

**Attributes**
```Typescript
// subscriptions attribute is used to store components subscriptions
subscriptions: any = {};
```

###### --- BasePage (extends BaseComponent)

Provides basic Page features + basic Component features.

###### --- BaseService (extends BaseClass)

Provides basic Service features + basic Class features.

**Attributes**
```Typescript
// events attribute is used to emit Service events
events: Subject<string> = new Subject();
```

###### --- BaseWebSocket (extends BaseService)

Provides basic WebSocket features + base Service features.

**Attributes**
```Typescript
// status (getter) attribute is used to retrieve current socket status based on socket STATUS_CODE
get status(): 'offline' | 'connecting' | 'online';
```

**Methods (overridable)**
```Typescript
// overridable methods to handle WebSocket events
onSend(message: any) { }
onError(err: any) { }
onMessage(event: any) { }
onOpen(event: any) { }
onClose(event: any) { }
```

###### --- Helpers

Generic useful Helpers, use as static methods.

**Methods**
```Typescript
Helpers.hash(length: number): string;
Helpers.styleScrollbars(elmt: HtmlDomElement): void;
Helpers.getURLParam(key: string): string;
Helpers.getFunctionsIcon(fns: any): void;
Helpers.fireEvent(node, eventName): void;
```

###### --- IconTranslator

Icon Translation helpers.

**Methods**
```Typescript
IconTranslator.iconForDepartment(departmentId: number): string;
```

###### --- Logger

Basic Logging features. Automatically disables in Production.

**Methods**
```Typescript
Logger.info(...args: any): void;
Logger.log(...args: any): void;
Logger.debug(...args: any): void;
Logger.warn(...args: any): void;
Logger.error(...args: any): void;
```

---
_Source: https://npm.io/package/ngx-elvis-base · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
