added pausing to event manager, added context aware entity schemas, fixed typings, first boot event, improved useEntityQuery mutation behavior

This commit is contained in:
dswbx
2024-12-20 20:11:49 +01:00
parent a7e3ce878a
commit deddf00c38
12 changed files with 148 additions and 55 deletions

View File

@@ -39,12 +39,12 @@ export default function SWRAndAPI() {
e.preventDefault();
if (!comment) return;
await r.mutate(async () => {
/*await r.mutate(async () => {
const res = await r.api.data.updateOne("comments", comment.id, {
content: text
});
return res.data;
});
});*/
return false;
}}

View File

@@ -13,7 +13,9 @@ export default function SwrAndDataApi() {
function QueryDataApi() {
const [text, setText] = useState("");
const { data, update, ...r } = useEntityQuery("comments", 2);
const { data, update, ...r } = useEntityQuery("comments", 2, {
sort: { by: "id", dir: "desc" }
});
const comment = data ? data : null;
useEffect(() => {