Why Writing to Signals Inside rxResource Streams Breaks Angular's Reactive Graph
A common pattern in Angular codebases using Signals involves developers placing tap() calls inside rxResource streams to update separate signals with fetched data. This approach silently works in zone-based Angular but triggers an NG0600 error when zoneless mode is enabled, because rxResource streams run inside Angular's reactive scheduler where signal writes are prohibited by design. The restriction exists to preserve Angular's glitch-free guarantee, which requires reactive contexts to remain read-only during evaluation. The recommended fix is to return all necessary data as a single typed value from the stream using map(), eliminating the need for side signals entirely. The core takeaway is that rxResource is a read primitive meant for fetching and transforming data, not for triggering side effects or acting as a command bus.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in