Skip to content

Commit

Permalink
Re-generate js code in es5
Browse files Browse the repository at this point in the history
  • Loading branch information
wux5 committed Sep 26, 2017
1 parent 89f8e57 commit 5b2ae24
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 39 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,23 @@ Flexible thresholder for all kinds of threshold triggers.
npm i --save type-thresholder
```

## Usage
## Usage - JS
```js
var Thresholder = require('type-thresholder').Thresholder;
var t = new Thresholder(3, 0, 0, 10, '>');
t.on('break', function() {
// alert...
});
t.on('clear', function() {
// clear...
});

t.push(11);
t.push(12);
t.push(13); // will trigger break event
```

## Usage - TypeScript
```js
describe('breaks when something happened X times consecutively', () => {
it('should break on X occurrences with boolean values', done => {
Expand Down
92 changes: 56 additions & 36 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "type-thresholder",
"version": "0.1.1",
"version": "0.1.2",
"description": "Flexible thresholder",
"main": "dist/index.js",
"scripts": {
Expand Down

0 comments on commit 5b2ae24

Please sign in to comment.