alibaba / alibaba/browser-extension-kit
感觉是挺好的项目,必须会 rxjs 才能用吗?
- Dominant language
- TypeScript
- Stars
- 119
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
没写过 angular,感觉 rxjs 挺难的,现在有个场景,两个数据源 subject 都是 array,现在我直接想把两个 array 放一起变成只有一层的 array,数据源变化就更新再放一起
```js
export default class MyBackground extends Background {
@subject('MyBackground::localStorage')
private storageSubject = new Subject<[string, string][]>()
@subject('MyBackground::cookies')
private cookieSubject = new Subject<[string, string][]>()
@observable(['popup', 'contentScript'])
private combinator = this.storageSubject.pipe(
combineLatestWith(this.cookieSubject),
)
}
```
看了好几天 rxjs,拿到的数据结构是 [[string, string][], undefined],总是嵌套着数组
请问如果 `combinator` 只要 [string, string][] 的结构应该是咋写
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the issue's TypeScript example, especially the storageSubject, cookieSubject, and combinator declarations, and verify the emitted value shape when either source changes. Done means documenting or demonstrating how the combined sources produce one flat [string, string][] value rather than a nested pair.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100