pmndrs / jotai

👻 Primitive and flexible state management for React
https://jotai.org
MIT License
18.87k stars 623 forks source link

[docs] put simplified core code in docs #983

Closed dai-shi closed 2 years ago

dai-shi commented 2 years ago

Looks like people like them: https://twitter.com/dai_shi/status/1484835169475653634 https://twitter.com/dai_shi/status/1485434083778117632

Maybe we put them in docs somehow?

First one

How Jotai Works

https://codesandbox.io/s/zealous-field-z2xk6?file=/src/App.js

Second one

How Jotai Works (long version)

https://codesandbox.io/s/affectionate-chandrasekhar-nuxms?file=/src/App.js

AjaxSolutions commented 2 years ago

Is the simplified core code intended just for learning how Jotai works or could it be used in production?

astahmer commented 2 years ago

I don't know if that's the right place to ask but if this kind of tweets gets in the docs, maybe some of these could be integrated (or mentionned ?) too ?

jotai diagrams: https://twitter.com/dai_shi/status/1384532412521009168

jotai comparisons with valtio/zustand: https://twitter.com/dai_shi/status/1381252474682535938

Decision Tree to Choose a Global State Library https://twitter.com/dai_shi/status/1348257768130560008

zustand vs. jotai: https://twitter.com/dai_shi/status/1372909917011542027 https://twitter.com/dai_shi/status/1477593623156105217

internal weakmap implementation animation diagram: https://twitter.com/dai_shi/status/1346770792797802496

jotai-jsx https://github.com/dai-shi/jotai-jsx https://twitter.com/dai_shi/status/1421676705106718725 https://twitter.com/dai_shi/status/1412790409646903301

benchmark vs recoil https://twitter.com/dai_shi/status/1480083292884172801

converting from recoil + example with r3f https://twitter.com/dai_shi/status/1477430821900648449

jotai-game https://github.com/dai-shi/jotai-game https://twitter.com/dai_shi/status/1483825915813855239 https://twitter.com/dai_shi/status/1483992971121143809

react memo approach using jotai https://twitter.com/dai_shi/status/1468875799327817730

7GUIs challenge https://twitter.com/dai_shi/status/1433804219828490241

dai-shi commented 2 years ago

@AjaxSolutions

Is the simplified core code intended just for learning how Jotai works or could it be used in production?

It's intended for learning purpose, but I made it properly as much as possible, so if the implemented feature is enough, it can probably be used for real use cases.

dai-shi commented 2 years ago

@astahmer

I don't know if that's the right place to ask but if this kind of tweets gets in the docs, maybe some of these could be integrated (or mentionned ?) too ?

Wow, you collected them well. I'm happy to see if someone works on organizing them and open a PR for docs. (maybe links with small notes work?)