question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

This function has two behaviors:

  1. Creates a promise that resolves after x milliseconds. This function is overloaded and instead of Number can also consume options object. If timeout not specified by options object, the returned promise resolves immediately.
RA.delayP(100); //=> resolves after 100 milliseconds with `undefined` value
RA.delayP({ timeout: 100, value: "val" }); //=> resolves after 100 milliseconds with `"val"` value
  1. Create a promise that rejects after the specified milliseconds. This function is overloaded and instead of Number can also consume options object. If timeout not specified by options object, the returns promise rejects immediately.
RA.delayP.reject(100); //=> rejects after 100 milliseconds with `undefined` value
RA.delayP.reject({ timeout: 100, value: new Error('error') }); //=> rejects after 100 milliseconds with `Error('error')` value

This PR should serve as a model template of PR for delayP function.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:22 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
char0ncommented, Oct 11, 2019

I was currently using mocha grep pattern for this mocha --grep <NAME_OF_YOUR_TEST>

Yes you can also use the grep, there are multiple ways how to achieve the same.

I have implemented the function like this so it is good to go. Also should I throw a error message if argument passed by the user is not a Number or Object

Nope, we try not to validate input arguments unless absolutely necessary.

1reaction
PranjalAgnicommented, Oct 10, 2019

Also I am using pipe to call resolveP how can I send the value param to resolveP?

Figured it out!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Anagram of delayp | Letters to Words - Unscramble.org
5 letter words made by unscrambling delayp · cause to be slowed down or delayed · time during which some action is awaited...
Read more >
Unscrambled DELAYP letters to Make 66 words | UnscrambleX
5 letter words you can make with delayp · delay · layed · leady · padle · paled · payed · pedal ·...
Read more >
DELAYP - Vensim
Returns a 3rd order exponential delay of the input and computes the in progress pipeline, conserving the input if the delay time changes....
Read more >
Anagram of delayp - Unscramble.me
What 5 letter words can be made from letters delayp ; delay, 9, 9 ; layed, 9, 9 ; leady, 9, 9 ;...
Read more >
delayP.js - Documentation
* Creates a promise which resolves/rejects after the specified milliseconds. *; * @func delayP; * @memberOf RA ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found