A base class that implements active-related functionalities.
$ npm install --save activable
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
Returns a new instance of Activable, with a status of active
, if provided, or false.
Returns a boolean indicating the state of the instance.
.isActive ()
will return true.
.isActive ()
will return false.
If active
is provided, the status will be set to its value.
Otherwise it will flip the current value.
MIT © Fabio Spampinato