Open
Conversation
Snyk has created this PR to upgrade rx from 4.0.8 to 4.1.0. See this package in npm: https://www.npmjs.com/package/rx See this project in Snyk: https://app.eu.snyk.io/org/ordnance-survey/project/e31f39db-205c-4c2a-9a30-252dc0959c76?utm_source=github&utm_medium=referral&page=upgrade-pr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was automatically created by Snyk using the credentials of a real user.
Snyk has created this PR to upgrade rx from 4.0.8 to 4.1.0.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
Release notes
Package name: rx
-
4.1.0 - 2016-03-07
- Build What You Want with
- Adding
- Parity with RxJS v5 names
- Other changes
const Rx = require('@ rxjs/rx');
const fromArray = require('@ rxjs/rx/observable/fromArray');
const Observable = require('@ rxjs/rx/observable');
const source = Rx.Observable.just(42)
// Prototype methods
- Bug fixes such as to
- The
- Documentation bug fixes
-
4.0.8 - 2016-02-17
from rx GitHub release notesWe are happy to announce the release of RxJS version 4.1. With this release came a few new additions as well as a new system for pulling in what you want.
Some of the changes are the following:
@ rxjs/rxrepeatWhenBuild What You Want with
@ rxjs/rxOne of the biggest requests with RxJS was to build only what you wanted. In previous attempts, we looked at a CLI to build what you wanted, but that was suboptimal experience. Instead, we have ported the existing code base to CommonJS format so that it works right out of the box with Node.js, or with your favorite bundler whether it is Browserify, Webpack, Rollup, etc.
By default, this brings in all of RxJS when you require the
@ rxjs/rxmodule:const subscription = Rx.Observable.from([1,2,3])
.filter(x => x % 2 === 0)
.map(x => x + 2)
.subscribe(x => console.log(
The answer is <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">x</span><span class="pl-kos">}</span></span>));// => The answer is 4
Now it is possible to bring in as much or as little as you want by only including the operators you want:
const filter = require('@ rxjs/rx/observable/filter');
const map = require('@ rxjs/rx/observable/map');
const source = fromArray([1,2,3]);
const filtered = filter(source, x => x % 2 === 0);
const mapped = map(filtered, x => x + 2);
const subscription = mapped.subscribe( x => console.log(
The answer is <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">x</span><span class="pl-kos">}</span></span>) );// => The answer is 4
Not only can you bring in certain operators, but you can also add each one to the prototype if you want the nice chaining feature as well.
// Add class methods
Observable.addToObject({
fromArray: require('@ rxjs/rx/observable/fromarray')
});
// Add instance methods
Observable.addToPrototype({
filter: require('@ rxjs/rx/observable/filter'),
map: require('@ rxjs/rx/observable/map')
});
const subscription = Observable.fromArray([1,2,3])
.filter(x => x % 2 === 0)
.map(x => x + 2)
.subscribe(x => console.log(
The answer is <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">x</span><span class="pl-kos">}</span></span>));In addition, we also added some distributions that you will find under our
src/modular/distfolder which contains all of RxJS built in a UMD style as well as a "lite" version as well. This should give you the building blocks for creating your own builds of RxJS and taking the only the operators you need.Adding
repeatWhenWe often try to keep parity with other Rx versions such as RxJava. To that end, we've added
repeatWhenwhich complements theretryWhenwe've had for quite some time. Rather than buffering and replaying the sequence from the source Observable, therepeatWhenresubscribes to and mirrors the source Observable, but only conditionally based upon the Observable you return from the call.Here is an example where we can repeat a sequence twice with a delay of 200ms in between time.
.repeatWhen(function(notifications) {
return notifications.scan((acc, x) => return acc + x, 0)
.delay(200)
.takeWhile(count => count < 2);
});
var subscription = source.subscribe(
x => console.log(
Next <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">x</span><span class="pl-kos">}</span></span>,err => console.log(
Error <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">err</span><span class="pl-kos">}</span></span>),() => console.log('Completed')
);
// => Next: 42
// 200 ms pass
// => Next: 42
// 200 ms pass
// => Completed
Parity with RxJS v5 names
Given the differences between RxJS v4 and RxJS v5, we've made the migration path easier by creating aliases for you such as the following:
Observable.prototype.race = Observable.prototype.amb;
Observable.prototype.mergeMap = Observable.prototype.flatMap;
Observable.prototype.switchMap = Observable.prototype.flatMapLatest;
Observable.prototype.exhaustMap = Observable.prototype.flatMapFirst;
Observable.prototype.exhaust = Observable.prototype.switchFirst;
Observable.prototype.publishReplay = Observable.prototype.replay;
// Object methods
Observable.bindCallback = Observable.fromCallback;
Observable.bindNodeCallback = Observable.fromNodeCallback;
Observable.race = Observable.amb;
Other Changes
ConnectableObservableso that if the underlyingSubjecthas been disposed, we will no longer attempt to resubscribe to it.startWithoperator no longer usesScheduler.currentThreadand now usesScheduler.immediate, as that caused issues with the backpressure operators such aspausableandpausableBuffered.RxJS version 4.0.8
Commit messages
Package name: rx
Compare
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:
🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs