harunurhan / idlejs

Execute stuff when user is idle or interactive
MIT License
37 stars 6 forks source link

How to call function of a class/Component, for the do function of Idle class #4

Closed ShaileshBhatNP closed 6 years ago

ShaileshBhatNP commented 6 years ago

I need to call like below

const idle = new Idle()
  .whenNotInteractive()
  .within(5,1000)
  //.do(() => console.log('IDLE'))
  .do(() => LoginPage)  //Need to call LoginPage
  .start();

Is it possible to achieve my requirement using this plugin..?

harunurhan commented 6 years ago

Well, do takes a js function where you can do anything you want. You want to route the LoginPage right? If you give me more details about your application like which framework you use, I can try to help.

(Sorry for the late answer, apparently notification settings were disabled 😞)

ShaileshBhatNP commented 6 years ago

Ionic Framework+Angular4 framework

harunurhan commented 6 years ago

I assume that you have @angular/router set up.