1import React, { useState, useRef } from 'react';
3import useInterval from 'lib/useInterval';
5// TODO: make these characters display as the same width
6export const kLoadingCharacter = '▓';
7export const kInterstitialCharacter = '░';
8const kBlinkAfterMs = 2500; // ms
10export const matchBlinky = obj =>
12 Nothing: () => <Blinky />,
16export default function Blinky({
17 a = kLoadingCharacter,
18 b = kInterstitialCharacter,
20 const [value, setValue] = useState(true);
21 const now = useRef(new Date());
24 // only start blinking if we've elapsed enough time
25 if (new Date() - now.current > kBlinkAfterMs) {
26 setValue(val => !val);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list