MCPcopy
hub / github.com/agentheroes/agentheroes / useToast

Function useToast

apps/frontend/src/hooks/use-toast.tsx:174–192  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

172}
173
174function useToast() {
175 const [state, setState] = React.useState<State>(memoryState)
176
177 React.useEffect(() => {
178 listeners.push(setState)
179 return () => {
180 const index = listeners.indexOf(setState)
181 if (index > -1) {
182 listeners.splice(index, 1)
183 }
184 }
185 }, [state])
186
187 return {
188 ...state,
189 toast,
190 dismiss: (toastId?: string) => dispatch({ type: "DISMISS_TOAST", toastId }),
191 }
192}
193
194export { useToast, toast }

Callers 9

VideoDialogFunction · 0.90
OpenGeneratorButtonFunction · 0.90
MediaCreationPageFunction · 0.90
MediaPageFunction · 0.90
MediaSelectionModalFunction · 0.90
CharactersPageFunction · 0.90
ToasterFunction · 0.90
CopyableInputFunction · 0.90
PostDialogContentFunction · 0.90

Calls 1

dispatchFunction · 0.85

Tested by

no test coverage detected