Code Monkey home page Code Monkey logo

Comments (2)

nathansobo avatar nathansobo commented on June 2, 2024

Our original plan was to allow you to detect changes just by inspecting the state. So if you're rendering a tree view, you can just retrieve the entries and re-render. If you have 3 buffers open, you can call changesSince for just those buffers whenever operations get applied to see if any have changed. We're open to iterating on this plan based on feedback. Definitely would be interested in what might work better for you in your use case.

from xray.

jessegrosjean avatar jessegrosjean commented on June 2, 2024

I think the changesSince API is good for buffers. Could something similar be added to work_tree to report file changes in the work tree?

It's true I can just determine this all by inspecting state. But if I want to update the view in an animated fashion then I need to know which exact files were inserted/removed/etc. I could do that by diffing states, but it gets expensive and complicated. Especially when all the information is already known by memo, seems like just exposing exactly what's changed would be nicer.

My use case is that I'm building a macOS file tree view as a learning project. The view can be updated in two ways. Simple way is to just reloadData... which reloads the entire view. Works, but it's somewhat expensive and doesn't provide any animation. On the other hand if I know exactly which files are removed/inserted/changed then I can just reload those portions of the view that have changed. It's faster and you get animation.

from xray.

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.