import { useEffect, useState } from "react";

export default function useShaderReader(url: string) {
    const [source, setSource] = useState<string>("");

    useEffect(() => {
        fetch(url)
            .then((res) => res.text())
            .then((txt) => setSource(txt));
    }, [url]);

    return source;
}
