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.

Add `delay` effect

See original GitHub issue

I keep copying+pasting the delay effect between my projects. Don’t you think it would be a good candidate to be included in redux-saga?

I have also enhanced the signature of the function to yield to true instead of undefined:

function delay(ms) {
  return new Promise(resolve => setTimeout(() => resolve(true), ms))
} 

Then you could easily check for timeouts in race

const { timeout, otherCall } = yield race({
  timeout: call(delay, 5000),
  otherCall: call(asyncFunc, ...)
})

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:18
  • Comments:20 (13 by maintainers)

github_iconTop GitHub Comments

68reactions
chenxsancommented, Apr 23, 2016

@Anahkiasen I think it’s import {delay} from 'redux-saga'.

11reactions
yelouaficommented, Mar 16, 2016

adding a delay util function could make sens. But adding a new effect here is irrelevant here since this is just an alias for a call effect. I prefer to keep the core small and focused

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Delay Effect: A Powerful Tool For Electronic Music
The delay effect is probably the most famous effect of all. Its echoing result is instantly recognizable and can add depth and emotion...
Read more >
4 Basic Types of Delays used on Vocals - Mixing Tips
If you want to check 4 basic types of delays that are used on vocals, follow this article. Adding delay on vocals article...
Read more >
How To Use Delay - Mastering The Mix
Delay is a powerful mixing tool for adding width, depth and dimension to your tracks. However, sometimes it can be difficult to dial...
Read more >
Using Delay Effects in Music Production - Renegade Producer
The delay effect is created by recording or buffering the signal and then playing back repeats of the signal at later points in...
Read more >
Delay Effect - what is it and how does it work - Samplecraze
The length of tape, tape speed and switching the head positions determined the delay time. Additionally, the delayed signal could then be fed...
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