Giter VIP home page Giter VIP logo

Comments (5)

javier-godoy avatar javier-godoy commented on September 26, 2024 1

The default value and the decrease logic are inherit from the original component that the add-on is based on. I would also expect that the count up never ends if no end time is defined. So how can we make the API less poor? Should we remove the default value in case on countUp or just replace the decrease logic or remove the default value completely from the component?

Any fix would be a breaking change, so let's figure out what makes most sense in this case.

IMHO either there should be no default value (some initial value is needed for count down, but there's nothing special in "60" and users will likely need to set an initial value that is different from 60), and/or there should be an endTime property that applies to count up, so that count up does not end at the so-called "startTime"

from simpletimeraddon.

paodb avatar paodb commented on September 26, 2024

The "problem" is here

|| (this.currentTime >= this.startTime && this.countUp) ) {
The calculations to know when to stop the counter are using the startTime. This property has a default value of 60. So, if you don't define a startTime (in this case it will be considered as a end-time) then it will stop at 60 seconds.

Should the default value for the startTime property be set to some other default when countUp is set?

from simpletimeraddon.

javier-godoy avatar javier-godoy commented on September 26, 2024

As a user, I would expect that the default value of "startTime" does not affect when the count up ends, and if there is no "endTime", I would expect that the count up does never end. (It does not matter how it is implemented. Having "startTime" act as "endTime", and having that end-time be 60 just because 60 is a reasonable default for count down, is poor API and does not make sense)

from simpletimeraddon.

paodb avatar paodb commented on September 26, 2024

The default value and the decrease logic are inherit from the original component that the add-on is based on. I would also expect that the count up never ends if no end time is defined. So how can we make the API less poor? Should we remove the default value in case on countUp or just replace the decrease logic or remove the default value completely from the component?

from simpletimeraddon.

mlopezFC avatar mlopezFC commented on September 26, 2024

At least the demo should make sense, when enabling the count up checkbox the textfield changes to "End time", we could populate it with 60.

image

from simpletimeraddon.

Related Issues (11)

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.