Skip to content

docs: updated readme with more API info#6

Merged
dai-shi merged 6 commits intovaltiojs:mainfrom
overthemike:update-docs
Jan 14, 2026
Merged

docs: updated readme with more API info#6
dai-shi merged 6 commits intovaltiojs:mainfrom
overthemike:update-docs

Conversation

@overthemike
Copy link
Contributor

No description provided.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 11, 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.

Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

Thanks for improving docs. Looks good overall.

README.md Outdated
Comment on lines +232 to +241
## API Stability

| Export | Status |
| ---------------- | -------- |
| `batch` | Stable |
| `computed` | Stable |
| `effect` | Stable |
| `unstable_watch` | Unstable |

The `watch` function is exported as `unstable_watch` to indicate its API may change. The core functionality is solid, but the exact behavior around edge cases may be refined.
Copy link
Member

Choose a reason for hiding this comment

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

Feels a bit AI-generated? I don't think we need to talk about unstable_watch, and this entire section could be dropped. I'm not even sure if we plan to make unstable_watch stable. It's there for the historical reason, and may help migration from jotai/utils's watch, but effect should be better for migration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A lot of it was AI generated with some editing by yours truly. I debated on whether to keep that section in and in the end decided to just push it up and get your opinion. I can definitely go in and reword or rewrite any of it. My goal here was to get something up and get it started.

So effect will be replacing watch, am I getting that right? It's essentially going to be an alias with an automatic cleanup function and watch will remain internal?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, watch will remain internal as of the current plan. We don't actually need to export it.

Copy link
Contributor Author

@overthemike overthemike Jan 12, 2026

Choose a reason for hiding this comment

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

Ok - I've updated the docs and removed watch and made effect the main star of the show and reworded some stuff.

Just out of curiosity, however, what's the reasoning? Is it so that it doesn't conflict with the old watch in valtio?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't actually need to export it.

Would you like me to create a new PR that removes it as an export?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, let's remove it then.
The reasoning is that "computed" and "effect" seem like a convention in the reactive libraries.

@dai-shi dai-shi merged commit 97c6351 into valtiojs:main Jan 14, 2026
2 checks passed
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