Have trouble reading Jotai code. Any help woud be appreciated. #1209
Replies: 1 comment 4 replies
-
It's function overload. I'm not 100% sure if If you need non-reactive get, you might want to try unstable_createStore and/or jotai-game. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am decent with JavaScript and also (I thought) good enough with TypeScript. But I have no idea what is happening here:
https://github.com/pmndrs/jotai/blob/main/src/core/atom.ts
You seem to be creating several functions with the same name and with no body. What is that for? Any links to typeScript where this is explained? I didn't think typeScript supports this.
What I am essentially trying is to create reactive write atom. Basically a write atom that has both reactive and non-reactive get. I need it to eventually create Effect atom, which is something I want to experiment with. That's why I am trying to understand the code.
Beta Was this translation helpful? Give feedback.
All reactions