feat: git hook config (husky eslint prettier)

This commit is contained in:
Amadou Ada DIENE
2021-07-20 10:51:46 +02:00
parent 1a5a76f912
commit 77b15bdfc4
33 changed files with 52217 additions and 51866 deletions

View File

@@ -2,39 +2,39 @@ import { Injectable, NgZone } from '@angular/core';
import { WindowApi } from 'shared-lib';
@Injectable({
providedIn: 'root',
providedIn: 'root',
})
export class ElectronIpcService {
private _api!: WindowApi;
private _api!: WindowApi;
constructor(private zone: NgZone) {
if (window && (window as Window).api) {
this._api = (window as Window).api;
console.log('Preloader API has been loaded successfully');
} else {
console.warn('Preloader API is not loaded');
}
}
constructor(private zone: NgZone) {
if (window && (window as Window).api) {
this._api = (window as Window).api;
console.log('Preloader API has been loaded successfully');
} else {
console.warn('Preloader API is not loaded');
}
}
public receive<Out>(channel: string, func: (output: Out) => void): void {
if (this._api) {
this._api.receive<Out>(channel, (output) => {
console.log(`Received from main process channel [${channel}]`, output);
public receive<Out>(channel: string, func: (output: Out) => void): void {
if (this._api) {
this._api.receive<Out>(channel, (output) => {
console.log(`Received from main process channel [${channel}]`, output);
// Next code might run outside of Angular zone and therefore Angular
// doesn't recognize it needs to run change detection
// Further details on SO : https://stackoverflow.com/a/49136353/11480016
this.zone.run(() => {
func(output);
});
});
}
}
// Next code might run outside of Angular zone and therefore Angular
// doesn't recognize it needs to run change detection
// Further details on SO : https://stackoverflow.com/a/49136353/11480016
this.zone.run(() => {
func(output);
});
});
}
}
public send<In>(channel: string, input: In): void {
if (this._api) {
console.log(`Sending to main process channel [${channel}]`, input);
this._api.send<In>(channel, input);
}
}
public send<In>(channel: string, input: In): void {
if (this._api) {
console.log(`Sending to main process channel [${channel}]`, input);
this._api.send<In>(channel, input);
}
}
}