Skip to content

Commit

Permalink
chore: upgrade to RxJS@7 (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
arturovt authored Aug 19, 2021
1 parent a99a5ed commit 461face
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ArrayOfSubscriptionsComponent } from '../array-of-subscriptions.compone
@Component({
selector: 'app-document-click',
templateUrl: './document-click.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DocumentClickComponent {
clientX$ = new BehaviorSubject<number>(0);
Expand All @@ -23,9 +23,9 @@ export class DocumentClickComponent {
const logger = loggerFactory.createLogger('DocumentClickComponent', '#b100aa');

this.subscriptions.push(
fromEvent<KeyboardEvent>(document, 'click')
fromEvent<MouseEvent>(document, 'click')
.pipe(
pluck<KeyboardEvent, number>('clientX'),
pluck('clientX'),
finalize(() => {
logger.log('fromEvent has been unsubscribed');
host.documentClickUnsubscribed$.next(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import { NotificationClass, NotificationText } from '../enums/notification.enum'
@Component({
selector: 'app-custom-method',
templateUrl: './custom-method.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CustomMethodComponent implements OnDestroy {
valueFromIntervalService$ = new BehaviorSubject<number>(0);

subscription = fromEvent<MouseEvent>(document, 'mousemove')
.pipe(
debounceTime(200),
pluck<MouseEvent, number>('clientX'),
pluck('clientX'),
finalize(() => this.logger.log('fromEvent has been unsubscribed'))
)
.subscribe(clientX => {
Expand Down
2 changes: 1 addition & 1 deletion libs/until-destroy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"sideEffects": false,
"peerDependencies": {
"@angular/core": ">=10.0.5",
"rxjs": ">=6.4.0"
"rxjs": "^6.4.0 | ^7.0.0"
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"minimist": "^1.2.5",
"ng-packagr": "^12.0.0",
"prettier": "^2.3.1",
"rxjs": "^6.5.2",
"rxjs": "^7.3.0",
"serve": "^12.0.0",
"standard-version": "^9.0.0",
"start-server-and-test": "^1.12.0",
Expand All @@ -102,6 +102,7 @@
"tabWidth": 2,
"printWidth": 95,
"endOfLine": "lf",
"singleQuote": true
"singleQuote": true,
"arrowParens": "avoid"
}
}
14 changes: 13 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10402,13 +10402,20 @@ [email protected]:
resolved "https://registry.yarnpkg.com/rxjs-for-await/-/rxjs-for-await-0.0.2.tgz#26598a1d6167147cc192172970e7eed4e620384b"
integrity sha512-IJ8R/ZCFMHOcDIqoABs82jal00VrZx8Xkgfe7TOKoaRPAW5nH/VFlG23bXpeGdrmtqI9UobFPgUKgCuFc7Lncw==

[email protected], rxjs@^6.5.0, rxjs@^6.5.2, rxjs@^6.5.4, rxjs@^6.6.0, rxjs@^6.6.3, rxjs@^6.6.6, rxjs@^6.6.7:
[email protected], rxjs@^6.5.0, rxjs@^6.5.4, rxjs@^6.6.0, rxjs@^6.6.3, rxjs@^6.6.6, rxjs@^6.6.7:
version "6.6.7"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9"
integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==
dependencies:
tslib "^1.9.0"

rxjs@^7.3.0:
version "7.3.0"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.3.0.tgz#39fe4f3461dc1e50be1475b2b85a0a88c1e938c6"
integrity sha512-p2yuGIg9S1epc3vrjKf6iVb3RCaAYjYskkO+jHIaV0IjOPlJop4UnodOoFb2xeNwlguqLYvGw1b1McillYb5Gw==
dependencies:
tslib "~2.1.0"

[email protected], safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
Expand Down Expand Up @@ -11615,6 +11622,11 @@ tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==

tslib@~2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a"
integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==

tsutils@^3.17.1, tsutils@^3.21.0:
version "3.21.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"
Expand Down

0 comments on commit 461face

Please sign in to comment.