【问题标题】:How can I order messages in the create-daml-app project in reverse chronological order?如何按时间倒序对 create-daml-app 项目中的消息进行排序?
【发布时间】:2020-09-07 10:41:43
【问题描述】:

我一直致力于向 create-daml-app 项目 (https://github.com/digital-asset/daml/tree/ba27ea9af4f39a9a3f307384e05f4bf540101f03/templates/create-daml-app) 添加一些小的 UI 功能。具体来说,我添加了文档 (https://docs.daml.com/getting-started/first-feature.html) 中的直接消息传递功能。那里的描述非常好,而且效果很好。默认情况下,消息按时间顺序显示(先发送到最后发送),我想按相反的时间顺序显示它们(最后发送到先发送)。有人可以帮我做这个吗?

谢谢。

【问题讨论】:

    标签: typescript react-tsx daml


    【解决方案1】:

    messagesResult.contracts 替换为messagesResult.contracts.reverse()

    【讨论】:

    • 感谢您的回复!这是我一开始尝试的,我得到了错误:“类型'readonly CreateEvent messagesResult.contracts.map(...).reverse())之后再次尝试,它完全有效!谢谢你的鼓励。
    猜你喜欢
    • 1970-01-01
    • 2013-09-14
    • 1970-01-01
    • 2022-01-13
    • 1970-01-01
    • 2016-05-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多