Skip to content

Instantly share code, notes, and snippets.

View ilyasakin's full-sized avatar
🤖
must. re. fac. tor.

ilyas akın ilyasakin

🤖
must. re. fac. tor.
View GitHub Profile
import axios, { AxiosInstance, AxiosRequestConfig } from 'axios';
import { set } from 'lodash-es';
import { IRequestParam } from '../model/http.model';
import HelperService from './helper.service';
export default class HttpService {
/**
* Axios instance
*/
protected readonly axios: AxiosInstance;
import { Notify } from 'quasar';
export default class NotificationService {
private readonly notify: Notify = Notify;
constructor() {
this.notify.setDefaults({
position: 'top-right',
textColor: 'white',
});
export default class LoggingService {
public log(message: string, payload: unknown = null): void {
console.log(`%cLOG: %c${message}`, 'color: yellow;', 'color: white');
if (payload) {
console.log('LOG_PAYLOAD: ', payload);
}
}
public error(message: string, payload: unknown = null): void {
<template>
...
<Spinner :status="isMainLoaderActive" />
...
</template>
<script setup lang="ts">
// imports ...
import { loadingService } from '../services/_singletons.ts';
import LoadingService from './loading.service.ts';
export const loadingService: LoadingService = new LoadingService();
import { reactive } from 'vue';
import { TLoadingKey } from '../model/loading.model';
export default class LoadingService {
private readonly TIMEOUT: number = 10000;
private readonly timeouts: Map<TLoadingKey, NodeJS.Timeout> = reactive(
new Map<TLoadingKey, NodeJS.Timeout>(),
);
<template>
...
<Spinner :status="isLoading" />
...
</template>
<script setup lang="ts">
// imports ...
const isLoading = ref<boolean>(false);
<template>
...
<Spinner :status="isLoading" />
...
</template>
<script setup lang="ts">
const isLoading = ref<boolean>(false);
const onClickSave = () => {