chore: remove unnecessary deps

This commit is contained in:
Johannes Millan 2020-07-06 00:53:23 +02:00
parent 8bfbdee7b9
commit ebf3d19611
5 changed files with 6 additions and 24 deletions

View file

@ -32,7 +32,6 @@
"contra/emitter",
"file-saver",
"semver",
"debounce-fn",
"stack-generator",
"stacktrace-gps",
"error-stack-parser",

View file

@ -125,7 +125,6 @@
"@types/node": "12",
"@types/semver": "^7.3.1",
"@types/shortid": "^0.0.29",
"@types/throttle-debounce": "^2.1.0",
"angular-material-css-vars": "^1.0.0",
"angular2-promise-buttons": "4.0.9",
"axios": "^0.19.2",
@ -136,7 +135,6 @@
"conventional-changelog-cli": "^2.0.21",
"core-js": "^3.1.3",
"cross-env": "^7.0.2",
"debounce-fn": "^4.0.0",
"electron": "^9.0.5",
"electron-builder": "^22.7.0",
"electron-notarize": "^1.0.0",
@ -179,7 +177,6 @@
"shortid": "^2.2.15",
"start-server-and-test": "^1.11.0",
"style-loader": "^1.2.1",
"throttle-debounce": "^2.0.1",
"ts-node": "~8.10.2",
"tslib": "^2.0.0",
"tslint": "^6.1.2",

View file

@ -9,7 +9,7 @@ import { TranslateService } from '@ngx-translate/core';
import { MatSnackBar, MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar';
import { Actions, ofType } from '@ngrx/effects';
import { setActiveWorkContext } from '../../features/work-context/store/work-context.actions';
import * as debounceFn from 'debounce-fn';
import { debounce } from 'helpful-decorators';
@Injectable({
providedIn: 'root',
@ -18,10 +18,6 @@ export class SnackService {
private _ref?: MatSnackBarRef<SnackCustomComponent | SimpleSnackBar>;
private _onWorkContextChange$: Observable<any> = this._actions$.pipe(ofType(setActiveWorkContext));
private readonly _debouncedOpenSnack
: (params: SnackParams) => void
= debounceFn(this._openSnack.bind(this), {wait: 100});
constructor(
private _store$: Store<any>,
private _translateService: TranslateService,
@ -38,7 +34,7 @@ export class SnackService {
if (typeof params === 'string') {
params = {msg: params};
}
this._debouncedOpenSnack(params);
this._openSnack(params);
}
close() {
@ -47,6 +43,7 @@ export class SnackService {
}
}
@debounce(100)
private _openSnack(params: SnackParams) {
const _destroy$: Subject<boolean> = new Subject<boolean>();
const destroySubs = () => {

View file

@ -9,10 +9,10 @@ import { filter } from 'rxjs/operators';
import { Reminder } from './reminder.model';
import { UiHelperService } from '../ui-helper/ui-helper.service';
import { NotifyService } from '../../core/notify/notify.service';
import { throttle } from 'throttle-debounce';
import { DialogViewNoteReminderComponent } from '../note/dialog-view-note-reminder/dialog-view-note-reminder.component';
import { DialogViewTaskRemindersComponent } from '../tasks/dialog-view-task-reminders/dialog-view-task-reminders.component';
import { DataInitService } from '../../core/data-init/data-init.service';
import { throttle } from 'helpful-decorators';
@NgModule({
declarations: [],
@ -23,8 +23,6 @@ import { DataInitService } from '../../core/data-init/data-init.service';
],
})
export class ReminderModule {
private _throttledShowNotification: any = throttle(60000, this._showNotification.bind(this));
constructor(
private readonly _reminderService: ReminderService,
private readonly _matDialog: MatDialog,
@ -44,7 +42,7 @@ export class ReminderModule {
this._uiHelperService.focusApp();
}
this._throttledShowNotification(reminders);
this._showNotification(reminders);
const oldest = reminders[0];
if (oldest.type === 'NOTE') {
@ -67,6 +65,7 @@ export class ReminderModule {
});
}
@throttle(60000)
private _showNotification(reminders: Reminder[]) {
const isMultiple = reminders.length > 1;
const title = isMultiple

View file

@ -1684,11 +1684,6 @@
resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9"
integrity sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA==
"@types/throttle-debounce@^2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@types/throttle-debounce/-/throttle-debounce-2.1.0.tgz#1c3df624bfc4b62f992d3012b84c56d41eab3776"
integrity sha512-5eQEtSCoESnh2FsiLTxE121IiE60hnMqcb435fShf4bpLRjEu1Eoekht23y6zXS9Ts3l+Szu3TARnTsA0GkOkQ==
"@types/webpack-sources@^0.1.5":
version "0.1.8"
resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-0.1.8.tgz#078d75410435993ec8a0a2855e88706f3f751f81"
@ -11958,11 +11953,6 @@ text-extensions@^1.0.0:
resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26"
integrity sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==
throttle-debounce@^2.0.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/throttle-debounce/-/throttle-debounce-2.2.1.tgz#fbd933ae6793448816f7d5b3cae259d464c98137"
integrity sha512-i9hAVld1f+woAiyNGqWelpDD5W1tpMroL3NofTz9xzwq6acWBlO2dC8k5EFSZepU6oOINtV5Q3aSPoRg7o4+fA==
through2@^2.0.0, through2@^2.0.2:
version "2.0.5"
resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd"