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.

Request gets executed before effect is run

See original GitHub issue

Running the following code prints Called, even though the effect is never run:

val service = HttpService[IO] {
  case GET -> Root =>
    println("Called")
    Ok()
}

val client = Client.fromHttpService(service)
client.expect[Unit]("/")
Thread.sleep(1000)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jmcardoncommented, Apr 12, 2018

For the record, this strictness is exactly why this was deprecated (would’ve outright removed it were it not for bincompat)

0reactions
drexincommented, Apr 11, 2018

Ah, that makes sense. I found this while debugging an issue which seemed to be caused by that, but I think I know what the problem is now. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's useEffect execution order and its internal clean-up ...
One thing that's not clear in the above answers is the order in which the effects run when you have multiple components in...
Read more >
Issue: `useEffect` executed before browser can paint DOM ...
Your event handler triggers a render, which has a passive effect and nothing special causes that effect to run before the paint. This...
Read more >
React useEffect Hook usages you must know - GreenRoots Blog
Learn the practical usages of useEffect Hook in React. This article shows you how to manage a component's side effects with various use ......
Read more >
useEffect(), Http Requests & Aborting - Academind
Imagine a case where out component is mounted and useEffect() hook executes but before the Http request completes, our component is unmounted ...
Read more >
The last guide to the useEffect Hook you'll ever need
An effect's cleanup function gets invoked every time, right before the execution of the next scheduled effect. Let's take a closer look at...
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