We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
untracked
effect
I run into a problem of infinite cycles in my project. Here is a reproduction snippet
import { effect, signal, untracked } from '@preact/signals-core'; import { expect } from 'chai'; describe('Untracked', () => { it('Nested `untracked` does not cause effect to run', async () => { const thisSignal = signal({}); let updateCount = 0; untracked(() => { effect(() => { untracked(() => { const _ = thisSignal.value; thisSignal.value = {}; updateCount++; }); }); }); expect(updateCount).to.eq(1); }); });
The code above will produce an error Error: Cycle detected, it happens because nested untracked causes effect to run.
Error: Cycle detected
I am wondering if this is expected behavior
The text was updated successfully, but these errors were encountered:
This was recently fixed in #512 but a new version has not yet been released.
Sorry, something went wrong.
Closing as released and fixed
@JoviDeCroock awesome, thanks
No branches or pull requests
I run into a problem of infinite cycles in my project.
Here is a reproduction snippet
The code above will produce an error
Error: Cycle detected
, it happens because nesteduntracked
causeseffect
to run.I am wondering if this is expected behavior
The text was updated successfully, but these errors were encountered: