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
/** | |
* Iterate a string runes. Same as iterating [...str] | |
* | |
* Note: This assume that the string is well-formed | |
* | |
* WARNING: This is useless, use the string iterator. | |
*/ | |
export function* runeIterator(s: string) { | |
const len = s.length; | |
let highSurrogate: number | undefined; |
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 { useRef, useEffect, useCallback } from 'react'; | |
import Split, { SplitOptions, SplitInstance } from 'split-grid'; | |
export function useSplitGrid(options: SplitOptions): SplitInstance | undefined { | |
const splitInstance = useRef<SplitInstance>(); | |
useEffect(() => { | |
const split = Split(options); | |
splitInstance.current = split; | |
return () => split.destroy(); |
OlderNewer