https://github.com/mathdroid/elevators
https://github.com/mathdroid/elevators
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mathdroid/elevators
- Owner: mathdroid
- License: mit
- Created: 2016-07-28T04:19:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-02T03:29:31.000Z (over 9 years ago)
- Last Synced: 2025-01-04T06:13:47.976Z (about 1 year ago)
- Language: JavaScript
- Size: 39.1 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Elevators
> A program that simulates freight lifts in React and Redux.
[](https://github.com/feross/standard)
## Installation
> Tested on Node v6.3.1. Node v4.0.0 or newer is recommended.
1. `$ git clone https://github.com/mathdroid/elevators`
2. `$ npm i`
3. `$ npm start`
==> 🌎 Open `localhost:7248`
## Testing
- `$ npm run test` -- single test
- `$ npm run watch` -- test watcher
## Globals
> There are two methods which are declared globally in ``, which are exposed in `window.controls` object.
```js
window.controls = {
checkButtonInFloor: (Number) => Boolean,
activateButton: (Number) => undefined
}
```
1. `checkButtonInFloor(floor)` will give you the status of the button in a specific `floor`. Returns `true` if it is activated.
2. `activateButton(floor)` will try to activate the button on the `floor`. Validity handling is internally checked.
### Usage
1. Open browser console
2. `controls.checkButtonInFloor(floor)` or `controls.activateButton(floor)`