Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snyk] Upgrade rx from 4.0.8 to 4.1.0 #114

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

mhill-os
Copy link

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.


  • The recommended version is 1 version ahead of your current version.
  • The recommended version was released 8 years ago, on 2016-03-07.
Release notes
Package name: rx
  • 4.1.0 - 2016-03-07

    We 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:

    • Build What You Want with @ rxjs/rx
    • Adding repeatWhen
    • Parity with RxJS v5 names
    • Other changes

    Build What You Want with @ rxjs/rx

    One 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/rx module:

    const Rx = require('@ rxjs/rx');

    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 fromArray = require('@ rxjs/rx/observable/fromArray');
    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.

    const Observable = require('@ rxjs/rx/observable');

    // 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/dist folder 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 repeatWhen

    We often try to keep parity with other Rx versions such as RxJava. To that end, we've added repeatWhen which complements the retryWhen we've had for quite some time. Rather than buffering and replaying the sequence from the source Observable, the repeatWhen resubscribes 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.

    const source = Rx.Observable.just(42)
    .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:

    // Prototype methods
    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

    • Bug fixes such as to ConnectableObservable so that if the underlying Subject has been disposed, we will no longer attempt to resubscribe to it.
    • The startWith operator no longer uses Scheduler.currentThread and now uses Scheduler.immediate, as that caused issues with the backpressure operators such as pausable and pausableBuffered.
    • Documentation bug fixes
  • 4.0.8 - 2016-02-17

    RxJS version 4.0.8

from rx GitHub release notes
Commit messages
Package name: rx
  • 11cd57f Updating to 4.1
  • c314375 Updating build
  • 4dd20e1 Fixing fromPromise
  • c3c817c Merge pull request #1141 from rhendric/cleanup
  • dfc828c Merge pull request #1144 from rhendric/fix/1112
  • c78cbde Merge pull request #1146 from garbles/patch-2
  • 8e4bb73 Merge pull request #1149 from inguin/master
  • c5d2ae7 Merge pull request #1153 from tabatkins/generate-not-fromArray
  • e24c7fa Fix doc for generate
  • 127fb35 Fix alphabetic order of method lists
  • 6dac036 Removing longrunning
  • f5e6be8 takeLast
  • c4d0e9a windowed/stopAndWait
  • 68d92e2 HistoricalScheduer
  • c15bf5c Adding pausableBuffered
  • 3e2e075 multicast: don't reconnect once subject is stopped
  • d578883 Fixing globals
  • 209d6ce ridding of globals
  • 63b89c7 Typo in when.md
  • fc3f671 Merge pull request #1142 from rhendric/pipe
  • d46a7b0 pipe: don't coerce all values to strings
  • e271816 prune unused files
  • 5fc6c6d startWith
  • 2cceb47 Merge pull request #1124 from yongxu/master

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants