const fetchUser = Effect.fn("fetchUser")(function* () {
const rpc = yield* RpcClient;
return yield* rpc.users.get({ path: { id: "abc" } });
}); // how to execute the effect so that createResource below returns the executed value
function Home() {
const [data, { mutate, refetch }] = createResource(fetchUser);
return (
<>
<h1>testing effect rpc</h1>
</>
);
}
const fetchUser = Effect.fn("fetchUser")(function* () {
const rpc = yield* RpcClient;
return yield* rpc.users.get({ path: { id: "abc" } });
}); // how to execute the effect so that createResource below returns the executed value
function Home() {
const [data, { mutate, refetch }] = createResource(fetchUser);
return (
<>
<h1>testing effect rpc</h1>
</>
);
}