Giter Site home page Giter Site logo

Comments (7)

ervinebalo avatar ervinebalo commented on May 29, 2024 1

@thibaultboursier I can create a PR to create a status

from use-timer.

thibaultboursier avatar thibaultboursier commented on May 29, 2024 1

Hello @ervine13,

I approved your PR and merged in into develop branch. I'll merge it into master soon, and will make a new version 2.0.0.
Then, we'll close this issue if it's OK for you.

Thanks ;-)

from use-timer.

ervinebalo avatar ervinebalo commented on May 29, 2024 1

Thanks, @thibaultboursier

from use-timer.

thibaultboursier avatar thibaultboursier commented on May 29, 2024

Hello @ervine13,

Thanks for opening this issue. It could be a good idea to have others states that just isRunning.
Can you give me an example of the kind of properties you would like to access when using this useTimer hook? isPaused, ...

Have a nice day.

from use-timer.

ervinebalo avatar ervinebalo commented on May 29, 2024

@thibaultboursier , sorry for the delayed response. isPaused was the only one I could think of. At least for my use case.

If you're open to more significant change, you could create a status property that returns 3 values active, paused, stopped.

from use-timer.

thibaultboursier avatar thibaultboursier commented on May 29, 2024

Hello @ervine13,

Very good idea to have a status property. It should make a breaking change and a new major release, as we currently return isRunning property, and we would remove it.

So, two choices to handle your point:

1. Return separate properties

We would return isRunning (maybe semantically better than isActive?), isPaused, isStopped.

2. Return a status string

We could create a status type:

export type Status = 'RUNNING' | 'PAUSED' | 'STOPPED';

We would update status value inside reducer.

What do you think? Would you like to make a PR?

from use-timer.

thibaultboursier avatar thibaultboursier commented on May 29, 2024

@ervine13 You rocks πŸ¦Έβ€β™‚οΈ

from use-timer.

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.