Add js web stuff to landing page + documentation

This commit is contained in:
2026-07-14 10:33:12 -04:00
parent fec8ef4a3e
commit 02a6dc6c48
435 changed files with 69567 additions and 1522 deletions

View File

@@ -0,0 +1,14 @@
// solid-js/html wrapProps auto-invokes zero-arg functions passed as component
// props, so handlers must use a parameter. Readers must accept either the
// unwrapped value or an accessor function.
export type MaybeAccessor<T> = T | (() => T);
export function readAccessor<T>(value: MaybeAccessor<T> | undefined | null, fallback: T): T {
if (value == null) return fallback;
return typeof value === "function" ? (value as () => T)() : value;
}
/** Reactive PageLayout/PageHeader prop — survives wrapProps (uses a dummy param). */
export function accessor<T>(fn: () => T): (_: unknown) => T {
return (_: unknown) => fn();
}