https://github.com/ghostffcode/toggl-walter
https://github.com/ghostffcode/toggl-walter
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ghostffcode/toggl-walter
- Owner: ghostffcode
- Created: 2017-02-14T18:43:11.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-16T01:09:55.000Z (over 9 years ago)
- Last Synced: 2024-10-18T20:48:36.395Z (over 1 year ago)
- Language: HTML
- Size: 37.1 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# toggl-walter
## Installation
To install from source, clone this repo and install dependencies.
with yarn:
```bash
$ yarn
```
Or npm:
```bash
$ npm install
```
## Usage
The output is built with a umd library target, you can use in browser:
```html
// WalterCalculator class is available here
var money = 30;
new WalterCalculator(money);
```
or node:
```javascript
const calc = require('./build/bundle.js');
const money = 30;
new calc(money);
```
### Concept
The `WalterCalculator` method can accept a callback function as a second argument, like so:
```javascript
//...
new WalterCalculator(money, function (data) {
// you have array of iterations
});
```
The array returned contains objects which include details (cycle, walter and leftOver) of each iteration, example data:
```javascript
{
cycle: 1,
walter: 26,
leftOver: 2.3
}
```
## Build
Build using webpack:
```bash
# with yarn
$ yarn run build
# with npm
$ npm run build
```
## Test
To run sample test case:
```bash
# with npm
$ npm run test
# with yarn
$ yarn run test
```