Code Monkey home page Code Monkey logo

Comments (5)

erickbelfy avatar erickbelfy commented on May 30, 2024

Let me ask you something, i can't see any flags or variables which control the visited items, do you think if we can implement a key named visited:boolean which controls the behaviour of each entry?

from hn-cli.

erickbelfy avatar erickbelfy commented on May 30, 2024

Another idea is on keypress event, we may change text of the selected node. Maybe it should work, but i have a concern if user add the option --keep-alive, when the display update, we may lose all visited entries.

from hn-cli.

rafaelrinaldi avatar rafaelrinaldi commented on May 30, 2024

@erickbelfy Yeah, we currently have no way to tell what item was previously visited but I was thinking about a flag on the cache object or even an array with the id of visited items. Not sure. Just keep in mind that the data should be immutable and we should try to avoid local state at all costs. Object.assign() can be our friend 👍

Also, the feature should behave the same either or not the user runs the program with --keep-open.

I also am not sure about the UI. As I said, maybe a bullet or even a text underline should do it. We shouldn't rely on colors though, since I want to support non xterm-256 users as well.

from hn-cli.

rafaelrinaldi avatar rafaelrinaldi commented on May 30, 2024

@erickbelfy Also, we can even add a feature to persist read items in the future 💡

from hn-cli.

erickbelfy avatar erickbelfy commented on May 30, 2024

Hey @rafaelrinaldi I would like to ask you something, you've mentioned about avoid local state at all costs, and use the cache object to store the visited items, do you think about use a package , like node-cache or you suggest use the cache API

from hn-cli.

Related Issues (14)

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.