export const withLoading = async <T>( loading_state: boolean, fn: () => Promise<T> ) => {
    loading_state = true;
    
    try {
        return await fn();
    } finally {
        loading_state = false;
    }
};