Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add docs for bunja #2938

Merged
merged 3 commits into from
Jan 17, 2025
Merged

docs: add docs for bunja #2938

merged 3 commits into from
Jan 17, 2025

Conversation

disjukr
Copy link
Contributor

@disjukr disjukr commented Jan 16, 2025

Summary

Bunja is new library like Bunshi but provides more guarantee about instance lifetime.

Check List

  • pnpm run fix:format for formatting code and docs

Copy link

vercel bot commented Jan 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
jotai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 17, 2025 7:26am

Copy link

codesandbox-ci bot commented Jan 16, 2025

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

pkg-pr-new bot commented Jan 16, 2025

Open in Stackblitz

More templates

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

commit: 9ffff05

Copy link

github-actions bot commented Jan 16, 2025

LiveCodes Preview in LiveCodes

Latest commit: 9ffff05
Last updated: Jan 17, 2025 7:25am (UTC)

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

See documentations for usage instructions.

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.

@disjukr disjukr changed the title docs: add bunja example docs: add docs for bunja Jan 16, 2025
@disjukr disjukr requested a review from dai-shi January 16, 2025 17:53

If you want to manage a state with a broad lifetime and another state with a narrower lifetime, you can create a (narrower) bunja that depends on a (broader) bunja.

For example, you can think of a bunja that manages the WebSocket connection and disconnection, and another bunja that subscribes to a specific resource over the connected WebSocket.
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to provide a simpler example to show the dependency case in this second section?

Copy link
Contributor Author

@disjukr disjukr Jan 17, 2025

Choose a reason for hiding this comment

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

Yes, replaced it with a modal screen example. 9ffff05

@dai-shi dai-shi merged commit 230e7e9 into pmndrs:main Jan 17, 2025
44 checks passed
@disjukr disjukr deleted the bunja branch January 18, 2025 04:27
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