下面的 pipe + map + sortBy 的排序代码,没有按照 useCount 降序排列,却按照升序排序,请问如何解决?
get allTags$() {
return (this._allTags$ ??= combineLatest([this.activeTags$, this.inactiveTags$]).pipe(
map(([activeTags, inactiveTags]) =>
sortBy(
activeTags.concat(inactiveTags),
['useCount'],
['desc']
)
),
shareReplay(1)
));
}
也就是 'desc' 没起作用
得用orderBy
一语惊醒梦中人