This file contains 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 { | |
useCallback, | |
useState, | |
} from "react" | |
/** | |
* Allows to use a Set as a state more conveniently. | |
*/ | |
export function useSet<T>(initialValues?: Iterable<T> | null) { | |
const [set, setSet] = useState<Set<T>>(new Set(initialValues)) |
This file contains 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
# source: https://gist.github.com/srflp/2da77871ed5e41edab913b3aaac85ba9 | |
# put this file in <your-repo>/.github/workflows/zip-top-level-directories.yml | |
name: Zip top-level directories | |
on: | |
push: | |
branches: | |
- main | |
jobs: |
This file contains 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
// Barcode Detector API Types | |
// remove these types after they get implemented in TypeScript | |
type BarcodeFormat = | |
| 'aztec' | |
| 'code_128' | |
| 'code_39' | |
| 'code_93' | |
| 'codabar' | |
| 'data_matrix' |