A program that simulates freight lifts in React and Redux.
Tested on Node v6.3.1. Node v4.0.0 or newer is recommended.
-
$ git clone https://github.com/mathdroid/elevators
-
$ npm i
-
$ npm start
==> 🌎 Open localhost:7248
-
$ npm run test
-- single test -
$ npm run watch
-- test watcher
There are two methods which are declared globally in
<App />
, which are exposed inwindow.controls
object.
window.controls = {
checkButtonInFloor: (Number) => Boolean,
activateButton: (Number) => undefined
}
-
checkButtonInFloor(floor)
will give you the status of the button in a specificfloor
. Returnstrue
if it is activated. -
activateButton(floor)
will try to activate the button on thefloor
. Validity handling is internally checked.
-
Open browser console
-
controls.checkButtonInFloor(floor)
orcontrols.activateButton(floor)