Giter Site home page Giter Site logo

Comments (11)

kimmobrunfeldt avatar kimmobrunfeldt commented on August 15, 2024

That's a good point. I remembered that self was passed as attachment but nope. At first glance, it seems that passing the path always as third parameter would be good solution

from progressbar.js.

prodigitalson avatar prodigitalson commented on August 15, 2024

If I have time later I'll try and update the docs, but as it stands I spent a bit to much time on this... Thanks for the crash course in Mocha and Sinon though ;-)

from progressbar.js.

prodigitalson avatar prodigitalson commented on August 15, 2024

So i was just updating the docs, and I wonder, should we update the Shape derived progress bars to pass an empty/merged object as attachment and then let them pass this as the third argument so that the API is consistent or are we ok with just allowing Path do this since its a special case?

from progressbar.js.

kimmobrunfeldt avatar kimmobrunfeldt commented on August 15, 2024

Good question. I think the best would be to pass reference to Shape or Path as a separate parameter and leave attachments only for the library user. I have implemented it so that by default, reference to Shape is passed as the attachment. If user overrides the attachment, they can't get reference to the Shape inside step function. That's not good. I think the attachment should be left for only library users. That way the internal reference passing wouldn't be messed up if user wants to customize the attachment.

I propose:

function step(state, self, attachment) { ... }

self is reference to Path or Shape derived progress bar depending which was initialized. This changes the API a bit, but the parameter order makes sense in the way that state and self always contain a value, attachment might be undefined.

from progressbar.js.

kimmobrunfeldt avatar kimmobrunfeldt commented on August 15, 2024

@prodigitalson What do you think?

from progressbar.js.

prodigitalson avatar prodigitalson commented on August 15, 2024

@kimmobrunfeldt That sounds much more intuitive/proper to me. I'll go ahead and get started on those changes and doc updates. Should I also do the MAJOR version bump or will you handle that?

from progressbar.js.

kimmobrunfeldt avatar kimmobrunfeldt commented on August 15, 2024

Ok sounds good. I'll handle the version bumps and release specific stuff. Since we are below 1.0.0 version, I'll do a minor bump.

from progressbar.js.

prodigitalson avatar prodigitalson commented on August 15, 2024

@kimmobrunfeldt Ok updates pushed. See my note on the PR and commit for some additional changes I made to the test setup.

from progressbar.js.

kimmobrunfeldt avatar kimmobrunfeldt commented on August 15, 2024

I was about to release new version with this included. But I found out a couple of issues. I'll fix them and make the release.

from progressbar.js.

kimmobrunfeldt avatar kimmobrunfeldt commented on August 15, 2024

This is now released as 0.8.0 https://github.com/kimmobrunfeldt/progressbar.js/releases/tag/0.8.0

from progressbar.js.

prodigitalson avatar prodigitalson commented on August 15, 2024

Great, i've been waiting for this release so I can update my project with the official dist. Thanks @kimmobrunfeldt

from progressbar.js.

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.