Closed VeryBueno closed 7 years ago
You do not have to use request
. If you'd like to handle the actual pinging logic yourself, just subscribe to Keepalive.onPing and do whatever you'd like.
See Extend your app component for a trivial example of how to subscribe to the event.
I'm submitting a ... (check one with "x")
Current behavior
The keepalive module accepts a string or Request in request() for configuring the ping request.
Expected behavior
I'd like to have the ability to pass a function that returns a promise.
Minimal reproduction of the problem with instructions
n/a
What is the motivation / use case for changing the behavior?
I have an app that needs to add special headers to HTTP requests. I extended Angular's Http to enable this. I'd rather use a service that I already wrote instead of manually constructing the Request to pass to keepalive.request().
Please tell us about your environment:
Idea, npm, linux
@ng-idle version: 2.x
Angular version: 2.x
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
All
Language: [all | TypeScript X.X | ES6/7 | ES5] All
Node:
node --version
= 6.10.3Thank you!