Skip to content

@react-rxjs/core@0.6.0

Compare
Choose a tag to compare
@josepot josepot released this 30 Oct 11:29
· 142 commits to main since this release
  • Breaking change: Subscribe is now a super-set of React.Suspense. The default fallback is still null, though.

  • Breaking change: We are no longer making the initial subscription on render. It's now the responsibility of the user to make sure that the initial subscription is there before the hook consumes the observable. That can be accomplished in many different ways, but the most common ones should be using Subscribe or with top-level subscriptions. In a nutshell what's going to happen is that if during render, if we have to throw a Promise to trigger suspense we won't create that promise unless the subscription of the Subject that's used for multicasting is already there. This guarantees that render is always free from side-effects.

  • Fix: If a "suspended" observable completes without emitting any values, we will throw an error that can be captured from an error-boundary.

  • Fix: If a Subscribe component gets unmounted while one of its children is on Suspense, the underlying observable will be disposed.