跳到主要内容

rxdb-react

React 框架集成库,为 React 应用提供 RxDB 支持。基于 React Hooks 实现响应式数据流。

功能特性

  • React Hooks 集成: 使用 useRxdb、useCollection 等 Hooks
  • 组件库: 提供数据展示、编辑、表单等常用组件
  • TypeScript 支持: 完整的类型定义

安装

npm install @aiao/rxdb @aiao/rxdb-react
# 或
pnpm add @aiao/rxdb @aiao/rxdb-react

使用

import { RxdbProvider } from '@aiao/rxdb-react';

function App() {
return (
<RxdbProvider>
<YourApp />
</RxdbProvider>
);
}

Fileoverview

RxDB React 集成包 提供 RxDB 数据库的 React Hooks 接口

Interfaces

InterfaceDescription
InfiniteScrollResource-
RxDBResource-

Variables

VariableDescription
RxDBProvider-
useRxDB-

Functions

FunctionDescription
makeRxDBProviderRxDB 依赖注入
useCountCount entities matching the criteria
useCountAncestorsCount ancestor entities in a tree structure
useCountDescendantsCount descendant entities in a tree structure
useCountNeighborsCount neighbor entities in a graph structure
useFindFind multiple entities matching the criteria
useFindAllFind all entities
useFindAncestorsFind all ancestor entities in a tree structure
useFindByCursorFind entities using cursor-based pagination
useFindDescendantsFind all descendant entities in a tree structure
useFindOneFind one entity matching the criteria
useFindOneOrFailFind one entity or throw an error if not found
useGet通过 ID 获取单个实体
useGraphNeighborsFind neighbor entities in a graph structure
useGraphPathsFind paths between two entities in a graph
useInfiniteScrollInfinite scroll hook for cursor-based pagination