Coder Social home page Coder Social logo

Comments (4)

moribvndvs avatar moribvndvs commented on August 19, 2024 1

$idle.watch() will reset state (both the idle state and the timers) and start a new time out. $idle.unwatch() will cancel all timeouts and stop running.

So, use watch if you want to start or reset, and unwatch if you want to pause or stop watching for idle.

Watch is the one you want.

Sent from my mobile phone.

On Aug 14, 2014, at 9:48 AM, Tihomir Kit [email protected] wrote:

I am not clear on how am I supposed to manually reset the timer so it wouldn't broadcast the $idleStart event?

Am I supposed to use:

$idle.watch();
or

$idle.unwatch();
$idle.watch();
or

$idleProvider.keepAlive();
or

$keepalive.ping();
// this one would probably need to be used in combination with a
// broadcast listener and one of the mentioned above?
Sorry if you feel this is a dumb question, but I'm just not clear which one of these should I use to reset the timer? What are the differences between them?

Thanks in advance


Reply to this email directly or view it on GitHub.

from ng-idle.

tihomir-kit avatar tihomir-kit commented on August 19, 2024

Thank a lot.

from ng-idle.

moribvndvs avatar moribvndvs commented on August 19, 2024

To be clear, if the user has timed out or you manually want to extend their session (because it is idle and in the warning/countdown phase), all you need is a single watch() call.

from ng-idle.

tihomir-kit avatar tihomir-kit commented on August 19, 2024

That was exactly what I needed, thanks. :)

from ng-idle.

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.