Skip to content

test(react/vanilla-utils/atomWithObservable): add test for 'Symbol.observable' interop protocol#3253

Open
sukvvon wants to merge 1 commit intopmndrs:mainfrom
sukvvon:test/atomWithObservable-symbol-observable
Open

test(react/vanilla-utils/atomWithObservable): add test for 'Symbol.observable' interop protocol#3253
sukvvon wants to merge 1 commit intopmndrs:mainfrom
sukvvon:test/atomWithObservable-symbol-observable

Conversation

@sukvvon
Copy link
Contributor

@sukvvon sukvvon commented Mar 4, 2026

Related Bug Reports or Discussions

N/A

Summary

  • Add test for atomWithObservable with Symbol.observable interop protocol
    • Verifies that atomWithObservable recognizes and subscribes to the observable returned by [Symbol.observable]()
    • Covers Symbol.observable detection and observable replacement path (line 83)

Check List

  • pnpm run fix for formatting and linting code and docs

@vercel
Copy link

vercel bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
jotai Ready Ready Preview, Comment Mar 4, 2026 7:45am

Request Review

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 4, 2026

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 4, 2026

More templates

npm i https://pkg.pr.new/jotai@3253

commit: 7bb1219

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

LiveCodes Preview in LiveCodes

Latest commit: 702278c
Last updated: Mar 4, 2026 7:44am (UTC)

Playground Link
React demo https://livecodes.io?x=id/CLE9UEURE

See documentations for usage instructions.

it('count state with Symbol.observable', () => {
const subject = new BehaviorSubject(1)
const observable = {
subscribe: subject.subscribe.bind(subject),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we remove this to test the behavior?

btw, I'm not sure if we should preserve supporting Symbol.observable in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants