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
/** | |
* pulse-sniffer.js | |
* — Detects any pulse on any GPIO pin with pigpio — | |
* | |
* • Requires: sudo apt-get install pigpio | |
* npm i pigpio | |
* • Start daemon once per boot: sudo pigpiod | |
* | |
* Run: sudo node pulse-sniffer.js | |
*/ |
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' }; |