MCPcopy
hub / github.com/stackryze/FreeDomains / useToast

Function useToast

src/hooks/use-toast.js:108–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106 };
107}
108function useToast() {
109 const [state, setState] = React.useState(memoryState);
110 React.useEffect(() => {
111 listeners.push(setState);
112 return () => {
113 const index = listeners.indexOf(setState);
114 if (index > -1) {
115 listeners.splice(index, 1);
116 }
117 };
118 }, [state]);
119 return {
120 ...state,
121 toast,
122 dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId })
123 };
124}
125export { useToast, toast };

Callers 11

CompleteProfileFunction · 0.90
SignupFunction · 0.90
ChangeEmailFunction · 0.90
LoginFunction · 0.90
VerifyEmailFunction · 0.90
ForgotPasswordFunction · 0.90
SetPasswordFunction · 0.90
ResetPasswordFunction · 0.90
MyDomainsFunction · 0.90
RegisterFunction · 0.90
DomainDetailFunction · 0.90

Calls 1

dispatchFunction · 0.70

Tested by

no test coverage detected