MCPcopy
hub / github.com/jamiepine/voicebox / useToast

Function useToast

app/src/components/ui/use-toast.ts:163–181  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

161}
162
163function useToast() {
164 const [state, setState] = React.useState<State>(memoryState);
165
166 React.useEffect(() => {
167 listeners.push(setState);
168 return () => {
169 const index = listeners.indexOf(setState);
170 if (index > -1) {
171 listeners.splice(index, 1);
172 }
173 };
174 }, []);
175
176 return {
177 ...state,
178 toast,
179 dismiss: (toastId?: string) => dispatch({ type: 'DISMISS_TOAST', toastId }),
180 };
181}
182
183export { useToast, toast };

Callers 15

SampleListFunction · 0.90
SampleUploadFunction · 0.90
ProfileFormFunction · 0.90
StoryListFunction · 0.90
StoryTrackEditorFunction · 0.90
StoryContentFunction · 0.90
ModelManagementFunction · 0.90
ConnectionFormFunction · 0.90
VoiceInspectorFunction · 0.90
MainEditorFunction · 0.90
GeneralPageFunction · 0.90
CapturesPageFunction · 0.90

Calls 1

dispatchFunction · 0.85

Tested by

no test coverage detected