Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
ultrox committed Aug 2, 2024
1 parent 6997719 commit a7e5489
Showing 1 changed file with 8 additions and 25 deletions.
33 changes: 8 additions & 25 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import {
QueryCache,
useQuery,
} from '@tanstack/react-query';
import toast, { useToaster } from './core/headless';
import toast from './core/headless';

const notify = () => toast('Here is your toast.');
const promise = () => {
toast.promise(
new Promise(r => setTimeout(r, 5000)),
Expand All @@ -23,17 +22,20 @@ const promise = () => {

const client = new QueryClient({
queryCache: new QueryCache({
onError: () => {
error('KOKO');
onError: (err) => {
toast.error(err.message)
},
onSuccess: (_data) => {
toast.success("All good1")
}
}),
});

const App = () => {
const data = useQuery({
useQuery({
queryKey: ['foo'],
retry: false,
queryFn: () => Promise.reject('fido'),
queryFn: () => Promise.reject(new Error("500: Server is using Nodejs")),
});
return (
<div>
Expand All @@ -50,22 +52,3 @@ export default () => (
<App />
</QueryClientProvider>
);

const Notifications = () => {
const { toasts } = useToaster();

return (
<div>
{toasts
.filter((toast) => toast.visible)
.map((toast) => (
<h2 key={toast.id}>{toast.message}</h2>
))}
</div>
);
};

const genId = (() => {
let id = 0;
return () => ++id;
})();

0 comments on commit a7e5489

Please sign in to comment.