mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
feat(sandbox): rebuild sandbox with shell UI and expanded templates (#773)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { getInitialSource, onSourceChange } from '../sandbox-listener';
|
||||
import type { SourceId } from '../sources';
|
||||
|
||||
export function useSource(audioOnly?: boolean): SourceId {
|
||||
const [source, setSource] = useState(() => getInitialSource(audioOnly));
|
||||
useEffect(() => onSourceChange(setSource), []);
|
||||
return source;
|
||||
}
|
||||
Reference in New Issue
Block a user