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.

Execute twice when use useObserveableState & useSubscription together

See original GitHub issue

Steps to reproduce

  1. useObservable
const value$ = useObservable(input$ => input$ |> switchMap([v] => ajax(...)), [props.value])
  1. useObservableState
const value = useObservableState(value$)
  1. useSubscription
useSubscription(value$, v => props.onChange(v))

What is expected?

just request once

what is actually happening?

request twice

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
FailLonecommented, Nov 6, 2019

It’s a amazing project! Thanks again!

0reactions
crimxcommented, Nov 6, 2019

You should not do that in useObservable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Subscriptions - Apollo GraphQL Docs
Executing a subscription. You use Apollo Client's useSubscription Hook to execute a subscription from React. Like useQuery , useSubscription returns an object ...
Read more >
Subscriptions - Client (React) - Apollo GraphQL Docs
Executing a subscription. You use Apollo Client's useSubscription Hook to execute a subscription from React. Like useQuery , useSubscription returns an object ...
Read more >
FetchMore : Request executed twice every time - Stack Overflow
My problem is the request is executed twice every time. I have no idea why. The first time, it is executed with a...
Read more >
useSubscription | Relay
API reference for useSubscription, a React hook used to subscribe and unsubscribe ... for use as a unique id for a given instance...
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