Skip to content

Commit

Permalink
style: remove unused oscillator
Browse files Browse the repository at this point in the history
  • Loading branch information
hubgan committed Jul 16, 2024
1 parent 581ae63 commit 28a4391
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ const BASE_FREQUENCY = 440;
const App: React.FC = () => {
const [frequency, setFrequency] = useState(BASE_FREQUENCY);
const osc = useRef<OscillatorNode | null>(null);
const osc2 = useRef<OscillatorNode | null>(null);

useEffect(() => {
if (!osc.current) {
const context = new AudioContext();
osc.current = context.createOscillator(+frequency);
osc2.current = context.createOscillator(+frequency);
}

return () => {
// TODO: Remove if and add cleanup function
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

Expand Down

0 comments on commit 28a4391

Please sign in to comment.