@electric-sql/pglite-react
TypeScript icon, indicating that this package has built-in type declarations

0.2.18 • Public • Published

PGlite React.js Hooks

This package implements React hooks for PGLite on top of the live query plugin. Full documentation is available at pglite.dev/docs/framework-hooks.

To install:

npm install @electric-sql/pglite-react

The hooks this package provides are:

  • PGliteProvider: A Provider component to pass a PGlite instance to all child components for use with the other hooks.
  • usePGlite: Retrieve the provided PGlite instance.
  • makePGliteProvider: Create typed instances of PGliteProvider and usePGlite.
  • useLiveQuery: Reactively re-render your component whenever the results of a live query change
  • useLiveIncrementalQuery: Reactively re-render your component whenever the results of a live query change by offloading the diff to PGlite

Package Sidebar

Install

npm i @electric-sql/pglite-react

Homepage

pglite.dev

Weekly Downloads

1,211

Version

0.2.18

License

Apache-2.0

Unpacked Size

37.2 kB

Total Files

9

Last publish

Collaborators

  • thruflo
  • icehaunter
  • sgwillis