Socket
Socket
Sign inDemoInstall

activable

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    activable

A base class that implements active-related functionalities.


Version published
Weekly downloads
1
decreased by-87.5%
Maintainers
1
Install size
8.32 kB
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 11 Nov 2018

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc