readCommitLogPage()
function readCommitLogPage(
executor,
branchId,
options?
): Promise<CommitLogPage>;
Defined in: packages/rxdb-plugin-working-tree/src/commit/commit-log.ts:131
读一个分支的提交历史,翻译成公开面的一页。
Parameters
| Parameter | Type | Description |
|---|---|---|
executor | TransactionExecutor | 调用方那个事务的执行器;本函数不自己开事务 |
branchId | string | 要读的分支;调用方(门面)从 active 分支令牌取 |
options | CommitLogOptions | 见 CommitLogOptions |
Returns
Promise<CommitLogPage>
Throws
RxDBError 该分支的 ref 行缺失时(0004 没跑完,不是空历史)
Remarks
ref 行读了两次(一次在这里取 headCommitId,一次在 listCommits 里):两次都是
同一事务内的主键点查。省掉一次的办法是让 listCommits() 把 ref 一起回传,而那会让
遍历函数的返回值为了一个展示字段长出第二种形状。