useConnections() emits a growing partial list once per relay on subscribe
- 主要語言
- TypeScript
- 星號
- 29
- 分支
- 3
- 平均合併
- 3 小時 5 分鐘
- 30 天內合併 PR
- 11
描述
`useConnections()` seeds the stream with one emission per relay
(`src/lib/stores/useConnections.ts:22-31`):
```ts
const init = relays.map((relay) => { ... });
return rxNostr.createConnectionStateObservable().pipe(
startWith(...init),
scanLatestEach(({ from }) => from)
);
```
`startWith(...init)` spreads N relays as N separate emissions, and
`scanLatestEach` emits after each one. A subscriber therefore receives N values on
subscribe, each a growing partial list — `[a]`, `[a, b]`, `[a, b, c]` — rather than
one value holding the initial state.
`NostrApp` passes this straight to its default slot, so consumers rendering
`{#each connections as connection}` see the list fill in one relay at a time on
every subscribe.
Determined by code reading.
## Direction
Emit the initial state as a single value (`startWith(init)` with an accumulator that
takes a list, or seed the scan directly).
貢獻指南
這個儲存庫沒有索引到貢獻指南
評估
這個 Issue 還沒有評估資料。