Solid Example
A Solid example with signal-based checks and object-aware rules
Purpose
examples/solid mirrors the React and Vue examples but uses Solid primitives. It is the clearest reference for how Permix behaves with signals and effects instead of React state or Vue refs.
What it demonstrates
- Solid integration with
PermixProviderandusePermix createEffect()-driven setup after the current user resolves- signal-friendly
isReady()andcheck(...)usage - declarative UI gating with the Solid
Checkcomponent
Core idea
The permission rule is the same ownership check used in the React and Vue samples:
edit: post => post?.authorId === user.id,The UI reads permissions through signals:
{isReady() ? 'Yes' : 'No'}
{check('post', 'edit', post) ? 'Yes' : 'No'}Run it
cd examples/solid
pnpm devKey files
src/lib/permix.ts: Solid Permix instance and generatedChecksrc/hooks/permissions.ts: Solid wrapper aroundusePermixsrc/App.tsx: effect-driven setup and per-post checks
When to use it
Use this as the reference implementation when you need Solid-specific ergonomics but the same typed permission model as the React and Vue examples.