diff --git a/src/App.tsx b/src/App.tsx index 7e61f5e..e81257d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -55,8 +55,8 @@ function App() { -
- red background +
+ blue background
diff --git a/src/NewFoo.tsx b/src/NewFoo.tsx index 3c4ca16..0e65ca8 100644 --- a/src/NewFoo.tsx +++ b/src/NewFoo.tsx @@ -1,6 +1,34 @@ +import {createSignal, createResource, Switch, Match, Show} from "solid-js" + +const fetchUser = async () => { + const response = await fetch(''); + return new Promise((resolve) => { + setTimeout(() => { + resolve(["abc", "def", "ghi"]); + }, 3000); // 2 Sekunden Delay + }); +} + function NewFooComponent(){ + const [userId, setUserId] = createSignal(); + const [user] = createResource(userId, fetchUser); + + setTimeout(()=>{ + setUserId(5); + },2000); return ( <> + + Loading... + + + + Error: {user.error} + + +
{JSON.stringify(user())}
+
+
New Foo