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

Function toast

src/hooks/use-toast.js:84–107  ·  view source on GitHub ↗
({ ...props })

Source from the content-addressed store, hash-verified

82 });
83}
84function toast({ ...props }) {
85 const id = genId();
86 const update = (props2) => dispatch({
87 type: "UPDATE_TOAST",
88 toast: { ...props2, id }
89 });
90 const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
91 dispatch({
92 type: "ADD_TOAST",
93 toast: {
94 ...props,
95 id,
96 open: true,
97 onOpenChange: (open) => {
98 if (!open) dismiss();
99 }
100 }
101 });
102 return {
103 id,
104 dismiss,
105 update
106 };
107}
108function useToast() {
109 const [state, setState] = React.useState(memoryState);
110 React.useEffect(() => {

Callers 15

handleSubmitFunction · 0.50
SignupFunction · 0.50
handleSignupFunction · 0.50
ChangeEmailFunction · 0.50
handleSubmitFunction · 0.50
LoginFunction · 0.50
handleEmailLoginFunction · 0.50
checkStatusFunction · 0.50
handleVerifyFunction · 0.50
handleResendFunction · 0.50
VerifyEmailFunction · 0.50
handleSubmitFunction · 0.50

Calls 3

genIdFunction · 0.70
dispatchFunction · 0.70
dismissFunction · 0.70

Tested by

no test coverage detected