finalize waku example

This commit is contained in:
dswbx
2025-07-09 08:21:39 +02:00
parent e21f1a3ee2
commit b4d6b1c04d
8 changed files with 10 additions and 28 deletions
@@ -1,5 +1,5 @@
import { createFrameworkApp } from "bknd/adapter";
import config from "../../bknd.config";
import config from "../bknd.config";
export async function getApp() {
return await createFrameworkApp(config, process.env, {
+1 -1
View File
@@ -5,7 +5,7 @@
import { Suspense, lazy } from "react";
import { getUserApi } from "../../lib/waku/server";
const AdminComponent = lazy(() => import("../../bknd/admin"));
const AdminComponent = lazy(() => import("./_components/AdminLoader"));
export default async function HomePage() {
const api = await getUserApi({ verify: true });
@@ -2,9 +2,9 @@
import type { BkndAdminProps } from "bknd/ui";
import { lazy } from "react";
import { BrowserOnly } from "../../lib/waku/client";
import { BrowserOnly } from "../../../lib/waku/client";
const AdminImpl = import.meta.env.SSR ? undefined : lazy(() => import("./impl"));
const AdminImpl = import.meta.env.SSR ? undefined : lazy(() => import("./AdminImpl"));
export const AdminLoader = (props: BkndAdminProps) => {
return (
+1 -3
View File
@@ -1,16 +1,14 @@
import { Link } from "waku";
import { Counter } from "../components/counter";
import { getUserApi, rerender } from "../lib/waku/server";
import { rerender, getUserApi } from "../lib/waku/server";
async function toggleTodo(todo: any, path: string) {
"use server";
console.log("toggleTodo", todo, path);
const api = await getUserApi();
await api.data.updateOne("todos", todo.id, {
done: !todo.done,
});
console.log("rerender");
rerender(path);
}