solid-pocketbase-hooks

0.1.0 • Public • Published

solid-pocketbase-hooks

import App from './App'
import { render } from 'solid-js/web'
import {PocketBaseProvider, AuthProvider, useRecord, useAuth} from 'solid-pocketbase-hooks'

render(
  () => <PocketBaseProvider url='https://some.pocket.base.host/'>
    <AuthProvider>
      <App />
    </AuthProvider>
  </PocketBaseProvider>,
  document.getElementById('root')
)

const App = () => {
  const { user } = useAuth()
  const record = useRecord('documents', 'foo')
  return <Show when={user()} fallback={<p>You are not logged in</p>}>
    <div>{record()}</div>
  </Show>
}

This project was created using bun init in bun v0.5.5. Bun is a fast all-in-one JavaScript runtime.

Package Sidebar

Install

npm i solid-pocketbase-hooks

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

10.7 kB

Total Files

9

Last publish

Collaborators

  • zmeu213