jotaijs / jotai-scope

MIT License
55 stars 4 forks source link

feat(scope): new implementation scoping atoms instead of store #5

Closed dai-shi closed 10 months ago

dai-shi commented 10 months ago

2 is suboptimal because we need to list all derived atoms in atoms prop in ScopedProvider.

In #4, @yf-yang suggested to change the api so that derived atoms work flawlessly.

This PR is another take of mine. ~The API is unchanged, but the behavior is very different.~ The API is also changed slightly.

codesandbox-ci[bot] commented 10 months ago

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.

Latest deployment of this branch, based on commit 7a8b4b6d4ad3a89ac5c86ccc2682d595efc599ce:

Sandbox Source
React Configuration
React TypeScript Configuration
dai-shi commented 10 months ago

Wait, it doesn't seem to work as expected. 🤔

yf-yang commented 10 months ago

I get your point, this implementation is elegant.