Skip to content

Commit

Permalink
chore(package): release new version
Browse files Browse the repository at this point in the history
  • Loading branch information
staltz committed Oct 19, 2016
1 parent cba84ca commit 1ef0019
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 19 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<a name="6.6.0"></a>
# [6.6.0](https://github.com/staltz/xstream/compare/v6.5.0...v6.6.0) (2016-10-19)


### Features

* **Stream:** accept partially defined listeners ([e9d005d](https://github.com/staltz/xstream/commit/e9d005d))



<a name="6.5.0"></a>
# [6.5.0](https://github.com/staltz/xstream/compare/v6.4.1...v6.5.0) (2016-10-17)

Expand Down
44 changes: 44 additions & 0 deletions EXTRA_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [`pairwise`](#pairwise) (operator)
- [`sampleCombine`](#sampleCombine) (operator)
- [`split`](#split) (operator)
- [`throttle`](#throttle) (operator)
- [`tween`](#tween) (factory)

# How to use extras
Expand Down Expand Up @@ -669,6 +670,49 @@ result.addListener({

- - -

### <a id="throttle"></a> `throttle(period)`

Emits event and drops subsequent events until a certain amount of silence has passed.

Marble diagram:

```text
--1-2-----3--4----5|
throttle(60)
--1-------3-------5-|
```

Example:

```js
import fromDiagram from 'xstream/extra/fromDiagram'
import throttle from 'xstream/extra/throttle'

const stream = fromDiagram('--1-2-----3--4----5|')
.compose(throttle(60))

stream.addListener({
next: i => console.log(i),
error: err => console.error(err),
complete: () => console.log('completed')
})
```

```text
> 1
> 3
> 5
> completed
```

#### Arguments:

- `period: number` The amount of silence required in milliseconds.

#### Returns: Stream

- - -

### <a id="tween"></a> `tween(config)`

Creates a stream of numbers emitted in a quick burst, following a numeric
Expand Down
35 changes: 18 additions & 17 deletions dist/xstream.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ var FromPromiseProducer = (function () {
}
}, function (e) {
out._e(e);
}).then(null, function (err) {
}).then(noop, function (err) {
setTimeout(function () { throw err; });
});
};
Expand Down Expand Up @@ -271,7 +271,7 @@ var PeriodicProducer = (function () {
}());
exports.PeriodicProducer = PeriodicProducer;
var DebugOperator = (function () {
function DebugOperator(arg, ins) {
function DebugOperator(ins, arg) {
this.type = 'debug';
this.ins = ins;
this.out = NO;
Expand Down Expand Up @@ -1036,15 +1036,9 @@ var Stream = (function () {
};

Stream.prototype.addListener = function (listener) {
if (typeof listener.next !== 'function'
|| typeof listener.error !== 'function'
|| typeof listener.complete !== 'function') {
throw new Error('stream.addListener() requires all three next, error, ' +
'and complete functions.');
}
listener._n = listener.next;
listener._e = listener.error;
listener._c = listener.complete;
listener._n = listener.next || noop;
listener._e = listener.error || noop;
listener._c = listener.complete || noop;
this._add(listener);
};

Expand Down Expand Up @@ -1211,7 +1205,7 @@ var Stream = (function () {
};

Stream.prototype.debug = function (labelOrSpy) {
return new (this.ctor())(new DebugOperator(labelOrSpy, this));
return new (this.ctor())(new DebugOperator(this, labelOrSpy));
};

Stream.prototype.imitate = function (target) {
Expand Down Expand Up @@ -1339,7 +1333,7 @@ module.exports = require('./lib/index');
'use strict';

Object.defineProperty(exports, "__esModule", {
value: true
value: true
});

var _ponyfill = require('./ponyfill');
Expand All @@ -1348,12 +1342,19 @@ var _ponyfill2 = _interopRequireDefault(_ponyfill);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var root = undefined;
var root;


if (typeof global !== 'undefined') {
root = global;
if (typeof self !== 'undefined') {
root = self;
} else if (typeof window !== 'undefined') {
root = window;
root = window;
} else if (typeof global !== 'undefined') {
root = global;
} else if (typeof module !== 'undefined') {
root = module;
} else {
root = Function('return this')();
}

var result = (0, _ponyfill2['default'])(root);
Expand Down
2 changes: 1 addition & 1 deletion dist/xstream.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xstream",
"version": "6.5.0",
"version": "6.6.0",
"description": "An extremely intuitive, small, and fast functional reactive stream library for JavaScript",
"main": "index.js",
"typings": "index.d.ts",
Expand Down

0 comments on commit 1ef0019

Please sign in to comment.