1
0
Fork 1
mirror of https://github.com/thatmattlove/hyperglass.git synced 2026-01-30 22:09:21 +00:00
thatmattlove-hyperglass/hyperglass/ui/hooks/useStrf.ts

8 lines
244 B
TypeScript

import { useMemo } from 'react';
import format from 'string-format';
type FmtArgs = { [k: string]: any } | string;
export function useStrf(str: string, fmt: FmtArgs, ...deps: any[]): string {
return useMemo(() => format(str, fmt), deps);
}