Skip to content

Instantly share code, notes, and snippets.

View juangl's full-sized avatar
🐝
Undefined

Juan Je GarcΓ­a juangl

🐝
Undefined
View GitHub Profile
const { Chip, Line } = require('node-libgpiod');
const COIN_GPIO = 21; // ⚠️ cambia al pin correcto
const GAP_US = 60_000; // hueco >60 ms - fin del tren
const WAIT_MS = 5; // pooling corto para minimizar pΓ©rdidas
/* ───── InicializaciΓ³n ─────────────────────────────────────────────── */
const chip = new Chip(0); // /dev/gpiochip0
const line = new Line(chip, COIN_GPIO);
import React, { useCallback } from 'react';
type FetchReducerActions<DataT> =
| { type: 'REQUEST_START' }
| { type: 'REQUEST_SUCCESS'; payload: DataT }
| { type: 'REQUEST_ERROR'; error: Error }
| { type: 'FETCH_NEXT_PAGE' }
// use to fetch again after an error
| { type: 'RETRY' };