mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
docs(solid-start): add JSDoc comments to adapter functions
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { DB } from "bknd";
|
||||
import { Suspense } from "solid-js";
|
||||
import { For, Suspense } from "solid-js";
|
||||
import { Footer } from "~/components/Footer";
|
||||
import { List } from "~/components/List";
|
||||
import { getApi } from "~/lib/bknd";
|
||||
@@ -58,9 +58,9 @@ export default function Home() {
|
||||
return (
|
||||
<div class="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 ">
|
||||
<main class="flex flex-col gap-8 row-start-2 items-center sm:items-start">
|
||||
<div class="flex flex-row items-center ">
|
||||
<div class="flex flex-row items-center justify-evenly min-w-full">
|
||||
<img
|
||||
class="dark:invert size-18"
|
||||
class="size-18"
|
||||
src="/solid.svg"
|
||||
alt="Solid Start logo"
|
||||
/>
|
||||
@@ -86,15 +86,14 @@ export default function Home() {
|
||||
</div>
|
||||
)}
|
||||
<div class="flex flex-col gap-3">
|
||||
{data()?.todos?.
|
||||
splice(0, data()?.limit ?? 0)
|
||||
.map((todo) => (
|
||||
<For each={data()?.todos?.splice(0, data()?.limit ?? 0)}>
|
||||
{(todo) => (
|
||||
<div class="flex flex-row">
|
||||
<div class="flex flex-row flex-grow items-center gap-3 ml-1">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="flex-shrink-0 cursor-pointer"
|
||||
checked={!!todo.done}
|
||||
checked={Boolean(todo.done)}
|
||||
onChange={async () => {
|
||||
await updateTodo(todo);
|
||||
}}
|
||||
@@ -113,7 +112,8 @@ export default function Home() {
|
||||
❌
|
||||
</button>
|
||||
</div>
|
||||
))}
|
||||
)}
|
||||
</For>
|
||||
</div>
|
||||
<form
|
||||
class="flex flex-row w-full gap-3 mt-2"
|
||||
@@ -124,7 +124,7 @@ export default function Home() {
|
||||
type="text"
|
||||
name="title"
|
||||
placeholder="New todo"
|
||||
class="py-2 px-4 flex flex-grow rounded-sm bg-foreground/10 focus:bg-foreground/20 transition-colors outline-none"
|
||||
class="py-2 px-4 flex flex-grow rounded-sm bg-black/5 focus:bg-black/10 dark:bg-white/5 dark:focus:bg-white/10 transition-colors outline-none"
|
||||
/>
|
||||
<button type="submit" class="cursor-pointer" disabled={submission.pending}>
|
||||
{submission.pending ? "Adding..." : "Add"}
|
||||
|
||||
@@ -43,7 +43,7 @@ export default function Home() {
|
||||
return (
|
||||
<div class="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20">
|
||||
<main class="flex flex-col gap-8 row-start-2 items-center sm:items-start">
|
||||
<div class="flex flex-row items-center ">
|
||||
<div class="flex flex-row items-center justify-evenly min-w-full">
|
||||
<img
|
||||
class="dark:invert size-18"
|
||||
src="/solid.svg"
|
||||
|
||||
Reference in New Issue
Block a user