@automerge/automerge-repo-react-hooks
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

React Hooks for Automerge Repo

These hooks are provided as helpers for using Automerge in your React project.

These hooks implement ephemeral awareness/presence, similar to Yjs Awareness. They allow temporary state to be shared, such as cursor positions or peer online/offline status.

Ephemeral messages are replicated between peers, but not saved to the Automerge doc, and are used for temporary updates that will be discarded.

Use RepoContext to set up react context for an Automerge repo. Use useRepo to lookup the repo from context. Most hooks depend on RepoContext being available.

Return a document & updater fn, by ID.

Return a handle, by ID.

Readme

Keywords

none

Package Sidebar

Install

npm i @automerge/automerge-repo-react-hooks

Weekly Downloads

1,585

Version

1.2.1

License

MIT

Unpacked Size

164 kB

Total Files

35

Last publish

Collaborators

  • orionhenry
  • memorythought
  • pvh
  • martinkl