This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' }; |