Socket
Book a DemoInstallSign in
Socket

activable

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

activable

A base class that implements active-related functionalities.

1.0.4
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Activable

A base class that implements active-related functionalities.

Install

$ npm install --save activable

Usage

import Activable from 'activable';

class Engine extends Activable {}

const engine = new Engine ();

engine.isActive (); // false
engine.activate ();
engine.isActive (); // true
engine.deactivate ();
engine.isActive (); // false

API

new Activable ( active?: boolean )

Returns a new instance of Activable, with a status of active, if provided, or false.

.isActive (): boolean

Returns a boolean indicating the state of the instance.

.activate (): this

.isActive () will return true.

.deactivate (): this

.isActive () will return false.

.toggleActive ( active: boolean = !this.isActive () ): this

If active is provided, the status will be set to its value. Otherwise it will flip the current value.

License

MIT © Fabio Spampinato

Keywords

activate

FAQs

Package last updated on 11 Nov 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.