start to tray updates
This commit is contained in:
parent
9795f02b74
commit
04e6fac5e4
|
@ -2,5 +2,5 @@ export class ElectronConstants {
|
||||||
static readonly enableMinimizeToTrayKey: string = 'enableMinimizeToTray';
|
static readonly enableMinimizeToTrayKey: string = 'enableMinimizeToTray';
|
||||||
static readonly enableCloseToTrayKey: string = 'enableCloseToTray';
|
static readonly enableCloseToTrayKey: string = 'enableCloseToTray';
|
||||||
static readonly enableTrayKey: string = 'enableTray';
|
static readonly enableTrayKey: string = 'enableTray';
|
||||||
static readonly enableStartMinimizedKey: string = 'enableStartMinimizedKey';
|
static readonly enableStartToTrayKey: string = 'enableStartToTrayKey';
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ export function sequentialize(cacheKey: (args: any[]) => string) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
value: function(...args: any[]) {
|
value: function (...args: any[]) {
|
||||||
const cache = getCache(this);
|
const cache = getCache(this);
|
||||||
const argsCacheKey = cacheKey(args);
|
const argsCacheKey = cacheKey(args);
|
||||||
let response = cache.get(argsCacheKey);
|
let response = cache.get(argsCacheKey);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
export function throttle(limit: number, throttleKey: (args: any[]) => string) {
|
export function throttle(limit: number, throttleKey: (args: any[]) => string) {
|
||||||
return <T>(target: any, propertyKey: string | symbol,
|
return <T>(target: any, propertyKey: string | symbol,
|
||||||
descriptor: TypedPropertyDescriptor<(...args: any[]) => Promise<T>>) => {
|
descriptor: TypedPropertyDescriptor<(...args: any[]) => Promise<T>>) => {
|
||||||
const originalMethod: () => Promise<T> = descriptor.value;
|
const originalMethod: () => Promise<T> = descriptor.value;
|
||||||
const allThrottles = new Map<any, Map<string, Array<() => void>>>();
|
const allThrottles = new Map<any, Map<string, Array<() => void>>>();
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ export function throttle(limit: number, throttleKey: (args: any[]) => string) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
value: function(...args: any[]) {
|
value: function (...args: any[]) {
|
||||||
const throttles = getThrottles(this);
|
const throttles = getThrottles(this);
|
||||||
const argsThrottleKey = throttleKey(args);
|
const argsThrottleKey = throttleKey(args);
|
||||||
let queue = throttles.get(argsThrottleKey);
|
let queue = throttles.get(argsThrottleKey);
|
||||||
|
|
Loading…
Reference in New Issue