Skip to content

Un-deprecate async useComputed$ #7560

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

Open
wmertens opened this issue May 1, 2025 · 2 comments
Open

Un-deprecate async useComputed$ #7560

wmertens opened this issue May 1, 2025 · 2 comments

Comments

@wmertens
Copy link
Member

wmertens commented May 1, 2025

Now that #7552 landed, we don't need deprecation any more.

However, we should add an eslint rule that checks when you use an AUC result synchronously, because that will always result in a restart of the running context.

@shairez
Copy link
Contributor

shairez commented May 6, 2025

@wmertens we discussed in today's meeting with @Varixo and the rest of the participants the need to revert back #7552.

Basically there are two options:

  1. We revert that PR to prevent footguns (because the fix you thought fixed this in feat: allow async operations in useComputed$ hook #7552 turned out to be just partially fixing it)
    and we introduce useAsyncComputed$ with a track function that returns a signal (unlike useTask which doesn't)

  2. Adding a lint rule as you suggested in here and adding a track function to the existing implementation.

I tend to go with option 1 because it makes things more explicit and less relying on linting rules (like you cannot go wrong when using useComputed$ because typescript will stop you first.
But I see the value in keeping both concepts in the same hook.

This is not a trivial one, @mhevery would love to also get your opinion on this

@Varixo
Copy link
Member

Varixo commented May 8, 2025

Related: #7561

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

No branches or pull requests

3 participants