When I try setting a signal
value from within an Observable
that gets piped to async
, I get the error:
Error: NG0600: Writing to signals is not allowed in a
computed
or aneffect
by default. UseallowSignalWrites
in theCreateEffectOptions
to enable this inside effects.
But I'm not inside a computed
or an effect
, I'm inside an Observable
. I also only get this through the async
pipe; if I subscribe to the Observable
and set my data
in the next
handler, it works as expected. Is this by design, or is it a bug?
refreshTrigger = new BehaviorSubject<void>(undefined);
refreshing = signal(false);
data = this.refreshTrigger.pipe(
tap(() => {
console.log("Refreshing");
this.refreshing.set(true);
}),
map(() => "Doing real work here"),
shareReplay(1)
);
{{refreshing() ? "Refreshing" : "Not refreshing"}} {{data | async}}