refactor(client): rename the host provide source to provideInfo

This commit is contained in:
imccyu
2026-07-28 11:03:56 +08:00
parent bce9910b47
commit 71529aa7d2
8 changed files with 10 additions and 10 deletions

View File

@@ -36,7 +36,7 @@ function hostOver(core: SlotCore): SlotRendererHost {
storeOf: () => undefined,
sessions: {
list: { getSnapshot: () => ({}), subscribe: () => () => {} },
provide: { getSnapshot: () => absentInfo, subscribe: () => () => {} },
provideInfo: { getSnapshot: () => absentInfo, subscribe: () => () => {} },
},
workspaces: {
list: { getSnapshot: () => ({}), subscribe: () => () => {} },

View File

@@ -126,7 +126,7 @@ function makeHost() {
},
sessions: {
list,
provide,
provideInfo: provide,
},
workspaces: { list: workspaces },
}

View File

@@ -26,7 +26,7 @@ function observable<T>(initial: T) {
}
/**
* Minimal host: SessionProvider only reads sessions.provide, but it must
* Minimal host: SessionProvider only reads sessions.provideInfo, but it must
* render inside the renderer tree (HostContext), so the harness mounts a real
* root entry whose body is the test's render-prop provider.
*/
@@ -51,7 +51,7 @@ function makeHost(bodies: { root: (rp: (key: string, owner: object) => React.Rea
storeOf: () => undefined,
sessions: {
list: observable<unknown>({ ids: [] }),
provide,
provideInfo: provide,
},
workspaces: { list: observable<unknown>({ items: [] }) },
}

View File

@@ -40,7 +40,7 @@ function makeHost() {
storeOf: () => undefined,
sessions: {
list: { getSnapshot: () => ({}), subscribe: () => () => {} },
provide: { getSnapshot: () => absentInfo, subscribe: () => () => {} },
provideInfo: { getSnapshot: () => absentInfo, subscribe: () => () => {} },
},
workspaces: {
list: { getSnapshot: () => ({}), subscribe: () => () => {} },