首页 问答 angular 中 rxjs + lodash 的 sortBy 排序问题
问题详情

下面的 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' 没起作用

版权:言论仅代表个人观点,不代表官方立场。转载请注明出处:https://www.stntk.com/question/222.html

发表评论
暂无评论

还没有评论呢,快来抢沙发~

点击联系客服

在线时间:8:00-16:00

客服QQ

70068002

客服电话

400-888-8888

客服邮箱

70068002@qq.com

扫描二维码

关注微信公众号

扫描二维码

手机访问本站