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

atomWithObservable can't recover from error (and also with any atoms?) #601

Closed
dai-shi opened this issue Jul 18, 2021 · 5 comments · Fixed by #705
Closed

atomWithObservable can't recover from error (and also with any atoms?) #601

dai-shi opened this issue Jul 18, 2021 · 5 comments · Fixed by #705
Labels
enhancement New feature or request

Comments

@dai-shi
Copy link
Member

dai-shi commented Jul 18, 2021

While working on #599, I noticed retrying from ErrorBoundary doesn't work (there's a failing test skipped). It's probably because the atom value (error) is stored in Provider, so re-render with the atom doesn't trigger a retry. If this is the case, we'd need to find a fundamental solution. 🤔

Better to start with investigating how useState + useContext would work.

@tsanyqudsi
Copy link

jotai v.1.2.1 apparently have this :

node_modules/jotai/utils/atomWithObservable.d.ts:13:5 - error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.

13     [Symbol.observable]?: () => ObservableLike<T>;
       ~~~~~~~~~~~~~~~~~~~

node_modules/jotai/utils/atomWithObservable.d.ts:13:13 - error TS2339: Property 'observable' does not exist on type 'SymbolConstructor'.

13     [Symbol.observable]?: () => ObservableLike<T>;

@dai-shi
Copy link
Member Author

dai-shi commented Jul 21, 2021

@tsanyqudsi Sorry about the inconvenience, #605 will fix it.

@tsanyqudsi
Copy link

my problem is confirmed : fixed with #605

@dai-shi
Copy link
Member Author

dai-shi commented Jul 21, 2021

@tsanyqudsi v1.2.2 is published with #605.

@tsanyqudsi
Copy link

updated and fixed. Thanks @dai-shi :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants