JSFiddle - React, Tailwind, and code Playground
by hallettj
JavaScript
var Engine = new Class({
start: function() {
!this.rotating && this.toggleRotate();
},
stop: function() {
this.rotating && this.toggleRotate();
},
toggleRotate: function() {
this.rotating = !!!this.rotating;
}.protect()
});
var engine = new Engine();
engine.start();
console.log('rotating?', engine.rotating);