scrabble-solver
Version:
Scrabble Solver 2 - Free, open-source, cross-platform, multi-language analysis tool for Scrabble, Scrabble Duel, Super Scrabble, Letter League, Crossplay, Literaki, and Kelimelik. Quickly find the top-scoring words using the given board and tiles.
21 lines (15 loc) • 360 B
text/typescript
import { useEffect } from 'react';
import { noop } from '@/lib';
export const useDirection = (direction: 'ltr' | 'rtl') => {
useEffect(() => {
const html = document.body.parentElement;
if (!html) {
return noop;
}
const old = html.dir;
html.dir = direction;
return () => {
html.dir = old;
};
}, [direction]);
};