Git Product home page Git Product logo

Comments (4)

iarna avatar iarna commented on June 11, 2024 1

Ah, that makes sense. I've got a patch for this and am meditating on how I want to test it, so it should land soonish. =)

from gauge.

iarna avatar iarna commented on June 11, 2024 1

Fixed in [email protected]! =)

from gauge.

iarna avatar iarna commented on June 11, 2024

Having more than one gauge at a time is pretty weird. What's your use case for that?

Currently the way it's written the expectation is that the onExit handler should exist as long as the gauge object does. As we have no way of knowing when a gauge object goes away, we have to hold on to it and it's going to be eternal.

I'm up for patching it so that it only keeps the onExit active as long as the gauge is enabled. This'd have the advantage of allowing disabled gauges to be garbage collected. Besides, having more than one gauge object enabled at a time is almost certainly an error as they'll write over each other. (If you have need of multiple gauges updating at once you're should be using gauge/plumbing and doing the screen updates yourself.)

from gauge.

sebdeckers avatar sebdeckers commented on June 11, 2024

@iarna Thanks for looking at this. :) Proposed patch sounds perfect.

It's not technically necessary to have them at the same time, which would be epilepsy-inducing, but merely instantiated in the same process over time. I encountered this in a CLI app that watches files and re-processes them, showing a new gauge each time. Upon the tenth file change it threw the above exit error. At no point was there more than one gauge visible, but their global event listeners were essentially leaking.

from gauge.

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.