docs: updated readme with more API info#6
Conversation
|
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. |
dai-shi
left a comment
There was a problem hiding this comment.
Thanks for improving docs. Looks good overall.
README.md
Outdated
| ## 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Yes, watch will remain internal as of the current plan. We don't actually need to export it.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
We don't actually need to export it.
Would you like me to create a new PR that removes it as an export?
There was a problem hiding this comment.
Yeah, let's remove it then.
The reasoning is that "computed" and "effect" seem like a convention in the reactive libraries.
No description provided.