Skip to content

Instantly share code, notes, and snippets.

View josueayala27's full-sized avatar
💚
Working Hard

Josué Ayala josueayala27

💚
Working Hard
View GitHub Profile
/**
* Configuration options for the waveform visualization.
*/
interface WaveformConfig {
barWidth?: number // The width of each bar in the waveform.
gap?: number // The gap between bars in the waveform.
maxBars?: number // The maximum number of bars to display.
minBarHeight?: number // The minimum height of a bar.
borderRadius?: number // The border radius of each bar.
barColor?: string // The color of the bars.
{
"purchase_list": [
{
"purchase_id": "1",
"product_name": "Apples",
"quantity": 3,
"unit_price": 1.99,
"total_price": 5.97,
"customer": {
"id": "101",
@josueayala27
josueayala27 / useApi.ts
Last active December 27, 2024 14:09
useApi.ts is a Vue.js composable that provides a simple interface for interacting with an API. This composable encapsulates the logic of making HTTP requests, handling responses, errors, and loading states, and conveniently provides the API data for use in Vue components.
import type { FetchOptions } from 'ohmyfetch';
import { useApiMethod } from '@/enums/composables/useApi';
/**
* Custom hook that makes an HTTP request to the API endpoint.
*/
export async function useApi<T>(
path: string,
opts?: FetchOptions,
prefix = 'api',
@josueayala27
josueayala27 / eslint_prettier_airbnb.md
Last active June 23, 2022 01:01
eslint_prettier_airbnb.md