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.

How to unobserve?

See original GitHub issue

All other frp libraries support some way to “unobserve”, and they all have slightly different implementations to support it. (offValue, dispose, etc…) Most does not seem to have any direct way to do this.

What do you suggest to people who want to accomplish this task?

//returns function to unobserve
var onValue =  function (stream, f) {
  var x;
  stream.takeWhile(function () { return !x; }).observe(f);
  return function () { x = 1; });
};

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
AlexGalayscommented, Apr 8, 2016

By the way, how do you debug whether your streams were properly disposed and are not creating memory leaks? Do something like an onDispose callback help diagnostic these?

0reactions
wclrcommented, May 23, 2016

Hah, cool, @TylorS so probably then subscribe could replace observe in most-adapter?

Read more comments on GitHub >

github_iconTop Results From Across the Web

IntersectionObserver.unobserve() - Web APIs | MDN
The IntersectionObserver method unobserve() instructs the IntersectionObserver to stop observing the specified target element.
Read more >
IntersectionObserver unobserve not working on target in ...
I'm trying to add elements to the page as the user scrolls down. When the last element comes into view fully I want...
Read more >
IntersectionObserver.unobserve() - Web APIs
The IntersectionObserver method unobserve() instructs the IntersectionObserver to stop observing the specified target element.
Read more >
How to unobserve · Discussion #504 · thebuilder/react ...
I created a hook like this: const { ref, inView, entry } = useInView(options);. I want to unobserve the referenced element at some...
Read more >
Javascript Intersection Observer API - removing the listener ...
This second param can be used to unobserve an element: const observer = new IntersectionObserver( (entries, observer) => { entries.
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