Giter Site home page Giter Site logo

Comments (4)

LegendAF avatar LegendAF commented on August 10, 2024 1

There was some discussion had about this in #51

Do you have more context as to what you are trying to accomplish?

from dash-chat-2.

SebastienBtr avatar SebastienBtr commented on August 10, 2024 1

Hey, this feature won't be implemented and let me explain a bit why:

  • First, it would add a lot of complexity to the package, talking from experience because that was the case on the original Dash Chat package. Because it's not just changing the reverse value, it's also having to change a lot of logic according to it.
  • There is no need for this parameter because you can pass your data in the other order
  • Fetching your messages by doing a descending order by on the creation date is the expected way, having it in this order forces developers to implement their chat in a more scalable way to enable pagination. You don't do a chat pagination by fetching the oldest message first. You do it like that:

page1: [message30, ..., message20] Where message30 is the last message sent in the chat (the newest message)

Then, if the user scrolls up, you load previous messages and append them to the original list:

page2: [message19, ..., message0]

messages list is now: [message30, ..., message0]

I hope that makes sense and you understand the design choice

from dash-chat-2.

rrsaikat avatar rrsaikat commented on August 10, 2024

@SebastienBtr I'm aware of the design pattern of this library and i'm also well known about the points you've mentioned. Nice explanations though.
@LegendAF At some case i need this, actually i'm running out of time to make fully functional chat UI. Okay no problem, thank you guys.

from dash-chat-2.

SebastienBtr avatar SebastienBtr commented on August 10, 2024

If you are running out of time and therefore won't change your way of fetching your messages for now, you can do a dirty .reverse() on your list of messages until you implement it in a proper way

happy coding!

from dash-chat-2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.